Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress Main report when sub-report return null d Post Reply Post New Topic
Author Message
albertleung
Newbie
Newbie


Joined: 20 Sep 2011
Online Status: Offline
Posts: 2
Quote albertleung Replybullet Topic: Suppress Main report when sub-report return null d
    Posted: 09 Oct 2011 at 11:24am
Hi everyone, I did try to look up the solution on Internet but I haven't found one for that yet. I used Crystal Reports XI to create a report with sub-report. I have two groups in my main report. In order to suppress the main report and sub-report section when sub-report returns null date, I have shared variable and the following logic in main report group headers and detail.

WhilePrintingRecords;
Shared DateVar subreportDate;

If IsNull(subreportDate) Then
   True
Else
   False

For some reason, it suppresses the next record instead of the current record. Please help.

Albert
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 12 Oct 2011 at 5:39am
what you would need to do is to run the subreport (or all the logic) BEFORE you display the main report line...so you would be running every subreport at least once and possible twice.
 
What you are seeing is the main report is already printed and then you have told it to suppress the main report...so it does on the next line.
 
HTH
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.047 seconds.