Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress duplicate subreport data Post Reply Post New Topic
Author Message
Apocalypso
Newbie
Newbie
Avatar

Joined: 26 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Apocalypso Replybullet Topic: Suppress duplicate subreport data
     Posted: 26 Jun 2009 at 4:30pm
Using Crystal Reports 11, I have a report with 2 subreports A and B. Sometimes the two subreports will show the same data. Is there a way to suppress data in subreport B if it already exists in subreport A?

My report is laid out as such:

Group 1 Header
Group 2 Header
Details
Group 2 Footer (Subreport A)
Group 1 Footer (Subreport B)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jun 2009 at 6:25am

This would be horrible from a performance standpoint but if you can create a shared variable in each sub report, pass those to the main report and then use them to suppress. However, since the variable in the main report has to be after the sub report you would have to run both sub reports to get the variables then run them each again to after that and conditinally supress using the main report shared variables. Running 4 sub reports each time for each group may really kill performance.

IP IP Logged
Apocalypso
Newbie
Newbie
Avatar

Joined: 26 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Apocalypso Replybullet Posted: 28 Jun 2009 at 4:02pm
Yes, that's a bit long winded for what I need. Thinking about it I could get by with a simple bit of code to suppress duplicated data in the subreport if it is already listed in the main report, like Suppress > if ({field}) = previous {field}

But this only seams to work within the subreport itself, not between subreport and main report.


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jun 2009 at 12:52pm

You can try to only bring the sub reports in as they are, use shared variables from them (put in a gf below the current Gfooters) and then conditionaly suppress the second subreport if these 2 variables are =. However, I am not sure if crystal would support this in a sequential manner or not. Ultimately you will need to bring in a shared variable to the mainreport to do some sort of comparison.

IP IP Logged
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