CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Multiple tables, diff. number of fields, one grid

Print topic Send  topic

Author Message
Mario

Posts: 14
Posted: 04/04/2012, 3:54 AM

Hello,
I have a database with several tables and each table has a different number of fields.

I would like to build a single grid that displays one table at a time (I can select from a listbox the table I want to show in the grid) but because of the different number of fields of each table I am having some problems...I don´t want to create a CCS page for each table but just one page with one grid that dinamically checks the number of fields of the selected table and then displays just those fields needed.

I have been checking the CCS documentation for some time:

- for instance, Dynamically Modify the SQL Statement in the help file :

Function Tasks_DataSource_BeforeBuildSelect(Sender)

Tasks.DataSource.SQL = "SELECT * FROM Tasks"

End Function
I guess that changing "from Tasks" to "from WhateverTableIHaveSelected" should work....

Any hints? (I don´t know if you have already noticed it but my expertise level is somehow set to "rookie")

Thanks in advance,

Mario
View profile  Send private message
Lucius

Posts: 220
Posted: 04/04/2012, 4:14 AM

Hi Mario,

I would suggest a different approach, as re-using a single grid for this task will be very difficult and messy...

Create a page with 3 Grids and other components that you might need, package them into separate panels.
When you will use a listbox it should show 1 panel containing the grid you need and others will be hidden.

This way you have the same end-result (1 page with 3 different grids) but much cleaner and easy to maintain code behind it.
View profile  Send private message
mor

Posts: 119
Posted: 04/04/2012, 4:16 AM

Mario,

Solution from Lucius - good idea. Simple and fast :)
_________________
Mor ve Ötesi
View profile  Send private message
Mario

Posts: 14
Posted: 04/04/2012, 5:47 AM

Thanks, I will try to implement it that way

A colleague here did something similar in Visual Basic coding from scratch: briefly, he created a mega-array with all the data (hidden) and then selected what needed and displayed it in the grid (no CCS at all). I tried to merge that code into CCS but not luck yet..

I´ll let you know...

Regards,

Mario
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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