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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameter to sub-report the uses a SQL command.

Status
Not open for further replies.

RWahlert

MIS
May 17, 2004
51
0
0
US
I have a report that contains one sub-report. Both the main report and sub-report are using SQL commands. The two reports use the same query in their respective commands. The main report points to a production server and database and the sub-report points to a test server and database. I do this so that I can easily compare the differences between the results of the test data to those of the production data.

In the main report there is a date parameter. I want to pass this date parameter to a parameter in the sub-report so they both have the same input. At this point I have been unsuccessful in passing the parameter to the sub-report.

Any thoughts on how to accomplish this would be appreciated.

Regards,

Ralph
 
The way that I do it is to have the same parameters in the main report and the sub-report. Then link the parameters. This has always worked for me.
 
How are you linking the two parameters? I tried doing that in the record selection formula but I was still presented with the parameter twice and the value was not passed from one to the other.

Could you provide a screen shot of how you did this?

Thanks.

Ralph
 
In the main report, go to edit->subreport links. Move the main report parameter to the right, and then in the bottom left, use the drop down to select {?yourparameter}, not the default {?pm-?yourparameter}.

You should not be adding anything to your selection criteria in the main report. All parameters should be created and used within the command. Otherwise the report will process locally and be much slower. Be sure to remove anything you added earlier in the selection formula area.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top