Print Page | Close Window

Sub-report blank after linking parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20267
Printed Date: 28 Apr 2024 at 11:49pm


Topic: Sub-report blank after linking parameter
Posted By: kj27
Subject: Sub-report blank after linking parameter
Date Posted: 03 Dec 2013 at 9:14am
Hello all,

I'm sort of at my rope's end as I have never faced this problem before. In Crystal X, I would simply like to pass a parameter to a sub-report. This parameter is actually a shared variable which is calculated on a different sub-report. I know the shared variable is good as it is dispaying properly on the main report.

But everytime I link the parameter to a (also working) sub-report, the subreport goes blank. I am not (at the moment) selecting sub-report data based on the parameter. Parameter type is date. The sub-report is located in one of the main report's detail sections.

Out of frustration, I created a formula on the main report with a static number in it and passed this into the sub-report and same result. I simply fail to see the issue. As soon as the sub-report has no parameters, it gets populated.

Your help is greatly appreciated.



Replies:
Posted By: kevlray
Date Posted: 03 Dec 2013 at 9:39am
If it is a shared variable, it should be available (through a formula) to the sub-report. i.e., Formula: someformula would contain shared numbervar somevar, then in the selection formula:  {somefield} = {@someformula}.

I think this would work


Posted By: kj27
Date Posted: 03 Dec 2013 at 10:33am
I completely agree with you. In fact, to bypass the nuisance of the parameter blanking out the sub-report, I made it into a shared variable.  And it shows up correctly on the the sub-report also.  The only problem is that shared variables aren't available for Record Selection.  For this purpose I'm forced to use a parameter. 


Posted By: kevlray
Date Posted: 03 Dec 2013 at 12:11pm
That is why you have to put the shared variable in a formula and use the formula in the record selection.  I am pretty sure I have done something like this in the past.


Posted By: kj27
Date Posted: 19 Dec 2013 at 11:22am
Hi kevlray,
 
Apologies for the late reply.  I do understand what you were suggesting and it should've worked.  For some reason it still didn't for my report.  I ended up replicating the selection as a command in the sub-report and then filter on top of that.  It's not efficient but considering the low volume of data, it was worth the trade-off.
 
Thanks again for your help - it's truly appreciated.


Posted By: DBlank
Date Posted: 20 Dec 2013 at 4:12am
Just out of curiosity did you double check the select statement inside the subreport after you created the link to remove the newly created parameter from within it?



Print Page | Close Window