Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Sub-report blank after linking parameter Post Reply Post New Topic
Author Message
kj27
Newbie
Newbie
Avatar

Joined: 15 Mar 2010
Location: United States
Online Status: Offline
Posts: 9
Quote kj27 Replybullet Topic: Sub-report blank after linking parameter
    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.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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
IP IP Logged
kj27
Newbie
Newbie
Avatar

Joined: 15 Mar 2010
Location: United States
Online Status: Offline
Posts: 9
Quote kj27 Replybullet 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. 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
kj27
Newbie
Newbie
Avatar

Joined: 15 Mar 2010
Location: United States
Online Status: Offline
Posts: 9
Quote kj27 Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.