CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamic grid

Print topic Send  topic

Author Message
Mac

Posts: 37
Posted: 06/11/2009, 1:04 AM

Hi folks,

I've been away from CC for a year or so, just picked it up again to develop something for myself and it seems i have forgotten so much!

I have a page with a record form at the top, and a grid below, I want the grid to only display records based on a value take from the top record form.

I've been playing with the WHERE statement in the grid data source but to no avail.

Any ideas please?

Thanks.
_________________
/\/\@<
View profile  Send private message
damian

Posts: 838
Posted: 06/11/2009, 4:39 AM

what is not happening for you?
is the grid displaying data when you dont want any or is it not displaying the data when you request some?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
Mac

Posts: 37
Posted: 06/11/2009, 5:36 AM

Sorry let me try and explain a little clearer.

I have a form at the top of the page populated with data from the master table.

I have a grid at the bottom of the page populated with date from the detail table.

I want the grid to display a subset of it's data based on a value from a field in the master form at the top of the page.

Right now it just shows all detail records.

I have a field in the detail table named parent_id which contains the id of the parent record in the master table.

I just cant find a way to pass this value from one for to another?

Thanks in advance.

Mac.
_________________
/\/\@<
View profile  Send private message
jjrjr1


Posts: 942
Posted: 06/11/2009, 5:43 AM

try

In the before show event for the form field set a session variable for the key you want to use to display the grid.

In the grid component use query builder and only select from the table the value of the saved session variable.

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Mac

Posts: 37
Posted: 06/11/2009, 5:54 AM

Thanks,

This is how I have done it in the past, but I was thinking there might have been a better way.

I'll do it like this again!

Mac.
_________________
/\/\@<
View profile  Send private message
damian

Posts: 838
Posted: 06/11/2009, 6:45 AM

in your where statement try choosing Use "Is Null" Condition
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
feha


Posts: 712
Posted: 07/09/2009, 1:24 PM

You can use a global ...

example
before show event of the form
global $desired_value;
$desired_value = $Component->field_name->GetValue();

than change query in before build select of the grid

global $desired_value;

.... WHERE desired_value= $desired_value etc ...


You can define value from the form as a constant
example
define("DESIRED_VALUE",$Component->field_name->GetValue());
in before show event of the form ...
than use it direct in query builder of the grid as

= DESIRED_VALUE
(expression)
and
default
-1

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

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.

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.