Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2009, 01:39 AM
jfreak53 jfreak53 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 10
Default QReport from form1

Is there a way to pass the table from my main form to my QReport form, unit1 to unit2? I don't want to have to make a new connection in the QReport window since I'm connecting to a MySQL DB on a server on the net it takes a long time to get the table, and since I already have what I want in the main form?? I have a DB connection, then an SQL table since I run a filter then I have a DataSource, regular. How do I pass this info over to the other form without re-downloading?

Thanks in advance.
Reply With Quote
  #2  
Old 09-17-2009, 02:09 AM
GeoWink GeoWink is offline
Senior Member
 
Join Date: Jan 2001
Posts: 785
Default

You should put the second form into the USES clause, the one after "implementation." Then that info will be available.

George
Reply With Quote
  #3  
Old 09-17-2009, 02:42 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 4,765
Default

As GeoWink said, put unit2 (the report unit) in USES clause of unit1 (main form) and the use the bellow code:


Code:
//QuickReport1 is in unit2 and Table1 is in unit1.
QuickReport1.DataSet := Table1;
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #4  
Old 09-17-2009, 03:48 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 4,765
Default

Or:

Code:
Unit2.QuickReport1.DataSet := Table1;
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #5  
Old 09-17-2009, 04:49 PM
jfreak53 jfreak53 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 10
Default

Perfect I wasn't getting it to pass the parameters to the other form, but were good now thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 05:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.