Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Parameters to main and subreport

Status
Not open for further replies.

jazbar

Technical User
Apr 26, 2006
37
GB
Hi all
Please could you advise me if it is possible to pass parameters to filter on both a main and subreport at the same time?
Thanks
 
Apologies for not advising, I'm using Crystal Reports XI DEveloper Edition.
Thanks
 
Technically a main and subreport don't execute at the same time, and subreports should be avoided, but yes, use the same criteria in each, and you can pass parameters from the main to the sub using the LINK.

You can also go in and manually edit the subreport record selection formula after linking if there's something amiss.

You should post what you're trying top do with an example of the main report record selection though, you question asks for a yes/no response, there's nothing specific.

-k
 
Edit>Subreport Link, to be exact. Note that it will want to link the parameter to soemthing and will place a selection rule in the subreport's record selection. This can be removed if you don't want it.

I often use a date parameter in both the main report and subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The Edit > Subreport Links has worked a treat! Thanks very much.
I have an orders_current and orders_history file, both with exactly the same columns and names. I wanted to be able to pull details of all orders for a particular customer on a certain date from both files. I've used the orders_current in the main report and the orders_history in the subreport. After using Edit > Subreport Links I can set the main report to pass those parameters to the subreport.
I had initially tried to create a Command using "select * from libraryname/orders_current UNION ALL select * from libraryname/orders_history" but this threw up the following error "Failed to retrieve data from database. Details: HY000:[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL5016 - Qualified object name orders_current not valid. [Database Vendor Code: -5016]" Has anyone any idea why or if I'm doing something wrong? The database I'm using is on AS400, software version 5, release 2, mod level 0.
Thanks for your help.
 
You need to start a new thread for a new problem. (Not one I can advise on.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top