CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 CCS Tutorial - Do Not Query Upon Entry??

Print topic Send  topic

Author Message
Chris Moore
Posted: 07/01/2003, 9:26 AM

I am going through the tutorial and I was wondering how to prevent the
query from executing when I first go into the Task List screen? I do not
want to show data in the grid until I key in a search paramter. How do I do
this?

Thanks.

Chris
Robert Rodgers
Posted: 07/01/2003, 11:15 AM

Hi Chris,

This was discussed on the www.gotocode.com forum recently.

Subject "How do I force the grid not to show data, unless"



rob

--
"Every absurdity has a champion to defend it"
Oliver Goldsmith
++++++++++++++++++++++++++++++

"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93AB74DEBDF79cabubba@66.180.229.147...
I am going through the tutorial and I was wondering how to prevent the
query from executing when I first go into the Task List screen? I do not
want to show data in the grid until I key in a search paramter. How do I do
this?

Thanks.

Chris

DonB
Posted: 07/01/2003, 11:38 AM

A useful thing to remember is controls do not execute their database queries
when they are not "visible". The control does not get rolled into the html
output at all, in fact.

You can suppress unwanted data by setting the appropriate control's
object.Visible = False (in ASP) or $object->Visible = false (in PHP)

DonB


"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93AB74DEBDF79cabubba@66.180.229.147...
> I am going through the tutorial and I was wondering how to prevent the
> query from executing when I first go into the Task List screen? I do not
> want to show data in the grid until I key in a search paramter. How do I
do
> this?
>
> Thanks.
>
> Chris

Sjg
Posted: 07/12/2003, 2:20 AM

Keep it Simple.....

***************************************
Option #1

You know the search grid will have parameters in the URL string for the
search to work.

So, on the link to the search page, pass a parameter that will result in no
records.

For example.

I have the following search grid page:

http://localhost/UserAccess_list.asp

This will bring back a list of all the users that have access. If I don't
want the grid to show records to begin with, I use the following to link to
the page:

http://localhost/UserAccess_list.asp?s_User_AccessStatus=noval

noval will never be an access status so no records will appear in the grid.

To accomplish this, set the properties for the link object.

On HRef Source Property, create a Link Parameter.

For the link Parameter:

Source Type: Expression
Parameter Source: "noval"
Parameter Name: s_User_AccessStatus

When the link is generated, it will be:

http://localhost/UserAccess_list.asp?s_User_AccessStatus=noval

Which will result in no records being shown.

***************************************

Option #2

Follow Option #1...

On HRef Source Property, create a Link Parameter.

For the link Parameter:

Source Type: Expression
Parameter Source: 0
Parameter Name: NoVal

When the link is generated, it will be:

http://localhost/UserAccess_list.asp?NoVal=0

Then .....

On the Grid Page (UserAccess_list.asp) add the value to the where clause

User_ID = {NoVal}

The User_ID Parameter is of Type URL.

Note: User_ID is a key field on the table, one that is not used in the
search, In this case, I used User_ID which is the primary autogenerated key.
It will never be zero so no records are shown.

On the Search, it is removed from the URL and the other search values are
placed int the URL string.

***************************************

Amount of code written - ***** NONE ******.
Code to Maintain ***** NONE ******.

While this may not work for every possible scenerio or requirement, it will
work as appropriate.

If Code Charge has been consistant in the models, this should work for PHP,
..Net, etc... as well.

While a lot of good coding methods to do this are posted, If you want to
change your project to another environment (ASP to PHP) all that code that
was put in the exits will have to be rewritten.

Look for the features of code charge, learn them, and apply them when
appropriate.

I would also question the requirement to show no records to begin with. If
you can go ahead and show the first 10 (or some other number) of records,
let it show them and show them every time the search grid is brought up. It
will mean less coding or altering the default properties (like solution
above). This in turn means less maintainence.

If it is required to not show any records until a search is done, use the
method #1 or #2 described above and have the search grid always not show
records until a search is done. It will require no coding and make the
project more portable to a different language.

Either show the records initially or do not show the records intially. Pick
one of the two methods and be consistent.

If you are not showing records initially use option #1 or Option #2, your
choice.

Option two has the User_ID and NoVal over on the Grid too. This can be a
reminder that you are starting with no records. However, two items are
being mofified; the page link item to the grid page and the rid on the grid
page.

Sjg....


"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93AB74DEBDF79cabubba@66.180.229.147...
> I am going through the tutorial and I was wondering how to prevent the
> query from executing when I first go into the Task List screen? I do not
> want to show data in the grid until I key in a search paramter. How do I
do
> this?
>
> Thanks.
>
> Chris


   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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