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

Passing parameter values to a subreport 2

Status
Not open for further replies.

youngcougar

Programmer
Sep 29, 2004
52
CA
I have a report that requires a user input parameter of an exchange rate. The subreport needs to use this exchange Rate. Is there any way to push a user input parameter to a subreport?

Any suggestions would be welcome.
 
Create the same parameter within the subreport, and then in the subreport links, link the main report parameter with the subreport parameter by using the dropdown in the lower left corner of the edit subreport links box to select {?parm}, NOT the default {?pm-?parm}. Then use the parameter in subreport formulas, etc.

-LB
 
Great, worked good!

Thanks.

Any way I can pass a variable to a subreport (not from) that isn't captured via a parameter?
 
Yes, in the main report, create the variable, and make it a shared variable. Then you can reference this in any subreport located in a section below the one in which the shared variable was created. For example:

//in the main report:
whileprintingrecords;
shared numbervar sumx := sum({Table.amt});

//in the subreport:
whileprintingrecords;
shared numbervar sumx;
sumx/count({table.ID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top