Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 19 Apr 2016 at 12:19pm
you have to run the the sub report in the main report header, pass a shared variable back that defines if the sub report is blank (E.g. a record count) making sure to use default values for nulls.
return the shared variable back to the main report in header b.
that value is now available to be used in the rest of the report as a suppression criteria.
if you need to display the sub report in another location you will have to run it twice.
If/when you have the time, would you please elaborate step by step?
I'll try to describe the report here. The main report consists of several data fields, nothing else. The sub-report has one formula, shown below, nothing else. The formula works as expected. When the formula shows no data, I want the main report details section to be blank as well.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 20 Apr 2016 at 8:54am
take a look at these two threads
there are a ton of posts on shared variables and sub reports.
http://crystalreportsbook.com/forum/forum_posts.asp?TID=17870
This goes in to detail on sub reports and shared variables, maybe more than you need.
This explains more why I suggested the order I did
http://crystalreportsbook.com/forum/forum_posts.asp?TID=18293
Let me know if you need more help or maybe someone else can post the sample shared variable code to more directly assist :)
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