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 -> General/Other

 Filterring Records

Print topic Send  topic

Author Message
Oper_a
Posted: 01/27/2004, 12:10 PM

example i have a record like this:
___________
MAN, 00001.....
MAN, 00002....
MAN, 00003....
GIRL, 00001...
GIRL, 00002..
OLD, 00005..
OLD, 00006..
OLD, 00007...
___________

i want to create a grid with only this records
___________
MAN, 00001
GIRL, 00001
OLD, 00005
___________
The firs of each one or just any of each one

i know how to doit code by code, but what the best way to implement this in CCS using Events?

peterr


Posts: 5971
Posted: 01/27/2004, 12:24 PM

You shouldn't need to use Events. Just in your Data Source use an SQL Query that groups your records by the first 3 characters and displays the 1st one of each grouping.
For example:
SELECT First(table_name.field_name) AS whatever FROM table_name GROUP BY Left(field_name,3);

Of course the query may become more complex if your records cannot be grouped by the 1st three characters. Your database may also have some specific capabiltiies, but I don't know which database you're using.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Oper_a
Posted: 01/27/2004, 3:55 PM

any way to add the GROUP BY using the UI or i need to changed directly to the code?
peterr


Posts: 5971
Posted: 01/27/2004, 4:46 PM

You can change the "Table" mode to "SQL" in the Data Source and then enter the SQL statement there. The SQL mode is provided specifically to offer more flexibility and resolve more complex requirements.
We plan to add visual query grouping functionality in the future.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Oper_a
Posted: 01/27/2004, 4:59 PM

That way worked perfect!
i just try to avoid doing change directly to code, cause get badly to do future changes using the UI

Thank
peterr


Posts: 5971
Posted: 01/27/2004, 5:07 PM

Understand. Don't be afraid of using SQL though :-) It is quite natural and safe. Even if the code & events change in the future, the SQL is an "external" but standardized source of data and always will be processed in the same way.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.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.