CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 To display grid display by default

Print topic Send  topic

Author Message
muhd fauzi
Posted: 02/11/2004, 7:25 PM

Where do I disable defautl grid display of data when it is first time open?
I just want to display data only after perform search parameter and not on
default.

tia

DonB
Posted: 02/11/2004, 7:58 PM

In it's before show event. Set the grid visible only when one of the search
parameters is given - check for the parameter using CCGetParam() function.

eg.:

MyGrid.Visible = CCGetParam("s_param1",-1) <> -1

or something similar.

--
DonB

http://www.gotodon.com/ccbth


"muhd fauzi" <mfauzim@hotmail.com> wrote in message
news:c0ero0$104$2@news.codecharge.com...
> Where do I disable defautl grid display of data when it is first time
open?
> I just want to display data only after perform search parameter and not on
> default.
>
> tia
>
>

muhd fauzi
Posted: 02/11/2004, 8:16 PM

Will the select sql be executed when set visible to false?

"DonB" <~ccbth~@gotodon.com> wrote in message
news:c0etlo$5ta$1@news.codecharge.com...
> In it's before show event. Set the grid visible only when one of the
search
> parameters is given - check for the parameter using CCGetParam() function.
>
> eg.:
>
> MyGrid.Visible = CCGetParam("s_param1",-1) <> -1
>
> or something similar.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "muhd fauzi" <mfauzim@hotmail.com> wrote in message
>news:c0ero0$104$2@news.codecharge.com...
> > Where do I disable defautl grid display of data when it is first time
> open?
> > I just want to display data only after perform search parameter and not
on
> > default.
> >
> > tia
> >
> >
>
>

peterr


Posts: 5971
Posted: 02/11/2004, 10:46 PM

Yes, it will.
Also see: http://support.codecharge.com/kb_article.asp?article_id=65

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
muhd fauzi
Posted: 02/11/2004, 11:36 PM

thanks
"peterr" <peterr@forum.codecharge> wrote in message
news:6402b2133c1fa7@news.codecharge.com...
> Yes, it will.
> Also see: http://support.codecharge.com/kb_article.asp?article_id=65
>
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google and CCS Docs/Examples in most of my answers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

DonB
Posted: 02/12/2004, 5:03 AM


"peterr" <peterr@forum.codecharge> wrote in message
news:6402b2133c1fa7@news.codecharge.com...
> Yes, it will.


Peter,

I expect you know far better than me on this, but can you explain, in light
of the following code? It was taken from a page with a Grid control. The
first line Exits the Show routine if "NOT visible". This prevents reaching
the DataSource.Open, which is where the database gets queried.

If "what" is not visible?

thanks,

Don



'JobSearch Show Method @3-85A83654
Sub Show(Tpl)
If NOT Visible Then Exit Sub

Dim RecordCounter, ShownRecords
Dim RowBlock

With DataSource
.Parameters("urls_StartDate") = CCGetRequestParam("s_StartDate",
ccsGET)
.Parameters("urls_JobSummary") =
CCGetRequestParam("s_JobSummary", ccsGET)
.Parameters("urls_BidOrPay") = CCGetRequestParam("s_BidOrPay",
ccsGET)
.Parameters("urls_JobWanted") = CCGetRequestParam("s_JobWanted",
ccsGET)
.Parameters("urls_Skill1") = CCGetRequestParam("s_Skill1",
ccsGET)
.Parameters("urls_Skill2") = CCGetRequestParam("s_Skill2",
ccsGET)
.Parameters("urls_Location") = CCGetRequestParam("s_Location",
ccsGET)
.Parameters("urls_BidOrPay_Max") =
CCGetRequestParam("s_BidOrPay_Max", ccsGET)
End With

CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me)
Set Recordset = DataSource.Open(Command)

Set TemplateBlock = Tpl.Block("Grid " & ComponentName)
Set RowBlock = TemplateBlock.Block("Row")
Set StaticControls = CCCreateCollection(TemplateBlock, Null,
ccsParseOverwrite, _
Array(Sorter_JobID, Sorter_ClientID, Sorter_DateCreated,
Sorter_JobSummary, Sorter_JobWanted, Navigator))
Set RowControls = CCCreateCollection(RowBlock, Null,
ccsParseAccumulate, _
Array(JobID, ClientID, DateCreated, JobSummary, JobWanted))

CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
If NOT Visible Then Exit Sub

Errors.AddErrors DataSource.Errors
If Errors.Count > 0 Then
TemplateBlock.HTML = CCFormatError("Grid JobSearch", Errors)
Else

' Show NoRecords block if no records are found
If Recordset.EOF Then
TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite
End If
While NOT Recordset.EOF AND ShownRecords < PageSize
JobID.Value = Recordset.Fields("JobID")
ClientID.Value = Recordset.Fields("ClientID")
DateCreated.Value = Recordset.Fields("DateCreated")
JobSummary.Value = Recordset.Fields("JobSummary")
JobWanted.Value = Recordset.Fields("JobWanted")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow",
Me)
RowControls.Show
Recordset.MoveNext
ShownRecords = ShownRecords + 1
Wend
Navigator.SetDataSource Recordset
StaticControls.Show
End If

End Sub
'End JobSearch Show Method

--
DonB

http://www.gotodon.com/ccbth

peterr


Posts: 5971
Posted: 02/12/2004, 5:28 PM

Don,

I probably don't know better, but searching the whole page code for "Public Visible" I can find it being defined within the "clsJobSearch" class definition. This likely means that "Visible" is the property of the current object (Grid).

BTW, it may be important to add that the Grid should be set to not Visible (GridName.Visible = False) in the "Before Show" event of the Page.
If it is set in the "Before Show" event of the Grid then the SQL will be executed. I'll check if there might be a reason for this.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
BlinkyBill

Posts: 86
Posted: 02/12/2004, 9:49 PM

Quote peterr:
Don,

BTW, it may be important to add that the Grid should be set to not Visible (GridName.Visible = False) in the "Before Show" event of the Page.
If it is set in the "Before Show" event of the Grid then the SQL will be executed. I'll check if there might be a reason for this.


This bit is spot on ! Drove me nuts trying to work this out. Before I worked this our I would just add WHERE 1 <> 1 to the WHERE parameter of the grid to effectively stop the query from processing.
View profile  Send private message
muhd fauzi
Posted: 02/12/2004, 10:45 PM

Yes it works, but it is acceptable performance, but if I use the search
parameters, then response is very slow . My config are:
Xp pro, mysql 4, IIS, 512Mb Ram,
The schema is star schema with 5 dimensions and 1 fact table. Below is the
query code


SELECT cid, custname, dim_customer.custkey AS dim_customer_custkey,
datadate, yy, mm, dd, `day`, weekend, dim_date.datekey AS dim_date_datekey,
dim_dnaA.dna AS dim_dnaA_dna, dim_dnaA.description AS dim_dnaA_description,
dim_dnaA.dnakey AS dim_dnaA_dnakey, hr, hrd,
dim_hour.hrkey AS dim_hour_hrkey, eir, AVERAGE_AVGUTIL, MAX_AVGUTIL, FLAG,
fct_traffic.custkey AS fct_traffic_custkey, dnaAkey,
dnaBkey, fct_traffic.datekey AS fct_traffic_datekey, fct_traffic.hrkey AS
fct_traffic_hrkey, dim_dnaB.dna AS dim_dnaB_dna,
dim_dnaB.description AS dim_dnaB_description, dim_dnaB.dnakey AS
dim_dnaB_dnakey
FROM ((((fct_traffic INNER JOIN dim_customer ON
fct_traffic.custkey = dim_customer.custkey) INNER JOIN dim_date ON
fct_traffic.datekey = dim_date.datekey) INNER JOIN dim_hour ON
fct_traffic.hrkey = dim_hour.hrkey) INNER JOIN dim_dna dim_dnaA ON
dim_dnaA.dnakey = fct_traffic.dnaAkey) INNER JOIN dim_dna dim_dnaB ON
dim_dnaB.dnakey = fct_traffic.dnaBkey
WHERE dim_customer.custkey LIKE '%{s_custkey}%'
AND dim_date.datekey = {s_datekey}
AND dim_dnaA.dnakey = {s_dim_dnaa_dnakey}
AND dim_dnaB.dnakey = {s_dim_dnaB_dnakey}
ORDER BY dim_dnaA.dna, dim_dnaB.dna

all the FK is integer, Ive tested the sql code with mysql manager and the
response is few mill sec. but when test it in using the web page, response
is very slow. Where else can I look to improve the performance? IIS
parameter, DB paramter etc

tx



"muhd fauzi" <mfauzim@hotmail.com> wrote in message
news:c0fad7$5lb$2@news.codecharge.com...
> thanks
> "peterr" <peterr@forum.codecharge> wrote in message
>news:6402b2133c1fa7@news.codecharge.com...
> > Yes, it will.
> > Also see: http://support.codecharge.com/kb_article.asp?article_id=65
> >
> > _________________
> > Peter R.
> > YesSoftware Support Representative
> > http://support.codecharge.com
> > Warning: I use Google and CCS Docs/Examples in most of my answers
> > ---------------------------------------
> > Sent from YesSoftware forum
> > http://forums.codecharge.com/
> >
>
>

peterr


Posts: 5971
Posted: 02/13/2004, 2:11 PM

Try using the same statement directly in MySQL and check how long it takes to execute.
Also please let me know how many records are being returned.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
muhd fauzi
Posted: 02/15/2004, 7:44 PM

I've tested directly with mysql wnad the response is subsecond. After futerh
analyze the form, I found out that one of the list box return more than 5K
record. This is the one contributing to the dealy. after resesign the form
to pop up search form, then the form works just fine.

thanks
"peterr" <peterr@forum.codecharge> wrote in message
news:6402d4b80ce023@news.codecharge.com...
> Try using the same statement directly in MySQL and check how long it takes
to execute.
> Also please let me know how many records are being returned.
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google and CCS Docs/Examples in most of my answers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.