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

Passing Parameters to a subreport 2

Status
Not open for further replies.

cafenerogal

Technical User
Mar 23, 2004
12
GB
Hi!

I'm using Crystal 8.5. I need to pass a string parameter from the main report to the subreport.

The manin report (in the Group Footer #1) is essentially a summary report of a business process, the subreport is exactly the same but a different view of the data. The subreport has been placed in the report footer.

The main report has 2 parameters, both are string the 1st string parameter has been passed to the subreport successfully, but I can't pass the second one and am prompted to enter a value for both the main report and the subreport.

I've followed the advice in an article posted last year Passing Paremeters to a Subreport - and I've got exactly the same problem! I've named the parameters the same, checked that they're both the same datatype and that both contain the same default values. In the subreport links box, in the dropdown at the botton left, I ONLY get the default {?pm-?parametername} I don't have any other selection options and can't edit the text.

In the Select Expert, the parameter is defined as follows:

(if {?Applications} = 'All' then true else
if {?Applications} = 'On-Time' then (isnull({CHOICES.LATE_FLG}) or {CHOICES.LATE_FLG} = 'F') else
if {?Applications} = 'Late' then {CHOICES.LATE_FLG} = 'T')

which is the same in the subreport.

Any help would be appreciated!

Cheers!
Hetal
 
I would do the null check first, as in:

(
if {?Applications} = 'On-Time' then
(
isnull({CHOICES.LATE_FLG}) or {CHOICES.LATE_FLG} = 'F'
) else
if {?Applications} = 'Late' then {CHOICES.LATE_FLG} = 'T' else
if {?Applications} = 'All' then true
)

Also, you added the same record selection formula to the subreport, right?

-LB
 
[thumbsup] Cheers LB, I'll give that a go. And yes the same record selection formula is in the subreport also.

Hetal
 
Hi Hetal,

when I started working with CR I had the same question. An expert pointed me to the following:

In the subreport links box the dropdown at the bottom left SEEMS to have only the default {?pm-?parametername}.

Make sure that the option "in subreport select data basing on the field" (or similar, I don't know the text exactly because my report is a german version) is not activated. The box on the buttom left does NOT have a usual drop down list with an arrow you can point on and the list opens. Instead it has a very, very small and tiny scroll bar instead of the arrow. Use this to scroll down and you will find the {?parametername} you have defined in the subreport. Link the main reports parameter to this one and the problem should be resolved.

HTH
Barbara
 
[2thumbsup] Thank you both!! Both parameters have been passed back to the subreport sucessfully! :-D

Cheers
Hetal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top