How to pass parameter fields from Main report to the subreport?I tried with shared variables, but it does not work....
Main report
Formula: @shMonth
shared numvervar shMonth;
shMonth={?Month};
subreport:
Formula @shMonth
shared numvervar shMonth;
The method you've described should work fine, depending upon WHERE in the main report you have your formula, and where you have the subreport.
The formula setting the shared vcariable must be placed in a section PRIOR to the subreport running.
Why don't you state the purpose of this? I'm guessing that there's a language barrier, but in any case, you should post WHAT you are trying to do, otherwise often times people come back and say I'm a newbie and was guessing at how I might accomplish something but my guess doesn't work, why don't I take the time to truly convey requirements now...
It only takes a few moments to state the basics:
Crystal version
database/connectivity used
Example data
Expected output
Main report shows the Sales MTD, YTD by product by SalesReps.The user can select the Month, the year , the SalesRep and the Product to filter.
I need to pass parameter fields from the main report to the subreport (the subreport is linked to the main by SalesrepID and ProductID)..it means ..i need to pass the selected Month(number) and the selected Year (number).
My subreport is in the group header (the main is grouped by product). I understood that i cannot use the share variables in the subreport in the record selection, because the shared var are evaluated at printing time (right?), so i use them directly in other formulas.Anyway my code seems to not work...
i hope i was clear...thx
You could just create the month parameter in the subreport, use it in the subreport record selection formula and then link the parameters in the main report and subreport to each other. Same for year.
No, actually. If you link the parameters to each other, you will only be prompted once. When you do the linking, move the main report parameter field to the right, and then use the dropdown in the lower to select {?yourparm}, not the default {?pm-?yourparm}.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.