CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Grid with Multiple Datasources?

Print topic Send  topic

Author Message
yourguide


Posts: 44
Posted: 05/18/2012, 11:53 AM

I need a grid that pulls data from two totally different database connections.
Anyone have any ideas where I should begin?
Custom editing the code is no problem... I am just new to Codecharge and want to do things the right way.
Thanks!

_________________
Independent, self-employed, web developer.
View profile  Send private message
DataDoIT
Posted: 05/18/2012, 12:54 PM

A grid component or control can't have multiple connections. Your
options are:

1. Have the grid pull data from connection1, then use events in the grid
to pull data from the second connection, such as Before Show, Before
Show Row, label Before Show, etc. You'll not be able to use the Sorter
on fields from the second connection.

2. Use a database view or stored procedure to combine the data needed,
then reference that view or SP from the CodeCharge grid control.
yourguide


Posts: 44
Posted: 05/18/2012, 1:18 PM

Thank you for your quick reply.
I think option 1 is the best, so now I just have to figure out how the Dlookup command is used to run a Dlookup before I display the one value I need to pull from another database.

That sounds right doesn't it? :-P Im so new at this...

_________________
Independent, self-employed, web developer.
View profile  Send private message
DataDoIT
Posted: 05/18/2012, 1:34 PM

Easy breezy. Just remember to quote where appropriate. Ex:

Expression: "yourField"
Domain: "yourTable"
Criteria: "yourKey=" . CCToSQL($Container->ds->f("yourKey"),
ccsInteger)
Connection: Connection2 <--- the name of your second connection
Convert result to: Integer
Type of Target: Control
Target: Name of your Control

Tip: Don't use fancy names for your connections. Stick with
"Connection1", or "Connection2", etc. It'll make things easier later
for reusing code or referencing code in your own library.
yourguide


Posts: 44
Posted: 05/18/2012, 1:42 PM

THANK YOU! That saved me some real time!
So if I worked through the tutorials would it help me learn these kinds of techniques? Or is there a Book or something for CodeCharge?

_________________
Independent, self-employed, web developer.
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.

MS Access to Web

Convert MS Access to Web.
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.