Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Total from Subreport Post Reply Post New Topic
Page  of 3 Next >>
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Topic: Total from Subreport
    Posted: 19 Oct 2016 at 3:58am
Hello, I am writing a report that i want to suppress the detail of if the total is zero. To get the total before I get into the detail, i placed a subreport in the group header section which adds up the detail, then i used shared variable to pass the total from the subreport to the main report. I then told the detail to suppress if that field is equal to zero. It is not working correctly. I even printed the field from the main report just to make sure it is returning the correct value, and it is.   I cannot understand why this would not work. It seems so simple. Any ideas ?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Oct 2016 at 4:10am
Not sure.  So you have verified that the sub-report variable is being set correctly by viewing it in the details section (via formula)? 
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 19 Oct 2016 at 4:16am
Hi, yes the total of both fields in the sub-report and main report are correct. I placed the sub-report in the group header, then added another section to the group header to show the value, just so that i could make sure it equalled the total in the detail section, which it does. So confused as to why this is not working. I have moved both the sub-report and the field around to different sections, just grasping at straws.

Edited by Kitty1 - 19 Oct 2016 at 4:35am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2016 at 6:35am
I assume you have multiple groups so you have a group header A that is setting the value to 0, a group header B executing the sub report and a group header C to return the shared variable back into the main report.
you are displaying the main report shared variable in group header C to validate each groups value is 'correct'.
This is not suppressing anything or only somethings?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Oct 2016 at 6:44am
I am not saying that you did this (I sure have), but did you confirm the shared variable name that you have for detail suppression is the same shared variable name that is used in the sub-report.
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 20 Oct 2016 at 7:37am
Hi kevlray & DBlank, thanks for the replies. I did check the shared variable and confirmed it is correct. I have found something even stranger now. i "un-suppressed" everything and the section is being suppressed on certain invoices only. There seems to be no rhyme or reason as to why some are and some are not. it is supposed to suppress any invoice (which it is grouped by) that has zero balance.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Oct 2016 at 11:33am
Almost seems that the shared variable is getting set by another process.  Hard to say without going through the report very carefully.
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 20 Oct 2016 at 11:47am
thanks, yea i can't see anything that would make it do this. i'm going to put it on the back burner for a while, then maybe go back to it. Thanks for all your input! :)

Edited by Kitty1 - 20 Oct 2016 at 11:47am
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 11 Nov 2016 at 7:40am
Hi, I am back at this again!   I have gone through everything in this report looking for any possible reason for this behavior and I am coming up with nothing. Very frustrating. Most all of the zero invoices are being suppressed, but certain ones are not and I see no difference in any way with these that are showing up. anyone have any other suggestions?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Nov 2016 at 2:58am
Create a formula that is your suppression formula and place it in the section that you want suppressed. I would suggest that you then look to see how the suppression is showing compared to the shared variable. Are you actually suppressing based on the prior shared variable (from the group above?)
IP IP Logged
Page  of 3 Next >>
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.029 seconds.