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

Pass Parameter to Subreport 1

Status
Not open for further replies.

back2tek

Technical User
Jan 12, 2006
64
US
Hi all,
My env is CR9 on SQLserver2000. I have a main report that has prompt string parameter <Category> which is not associated with a database field. It is a logical grouping of employee levels, For Example category A are employees with <table.level> = 1,2,3
and so on.
My selection is something like
if ?Category= A then table.level in [1 to 3]
else
if ?Category= B then table.level in [4 to 6]

My question is how can I pass the ?category to a subreport to retrieve additional information from unrelated table.
When going to change subreports link and select ?category there is no field in the subreport to link to.
Thank you for your help
B2T
 
You don't have to link to a field in the subreport. This just means that the record selection formula in the subreport will not be created automatically for you. Instead, you would notice that the subreport has a new parameter and you can do anything you want with it (its value will be automatically set to the link you are passing in.

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thank you Ido. I created the paramter in the main report and right click on th subreport. I selected the paramter and drag it to the box (fields to link to).Deselect the option (select data in subreport based on) then press enter. I still can't see paramter created in the subreport.

B2T
 
I would create the same parameter in the subreport, add the same formula to the record selection formula in the subreport, and then link the parameter in the main report to the parameter in the subreport. In the linking screen, use dropdown in the lower left to choose {?category}, NOT the default {?pm-?Category}.

-LB
 
Ido & Lbass,
Thank you so much for your help. Works fine now, applying Lbass steps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top