Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppressing row with zero value Post Reply Post New Topic
Author Message
johnkret
Newbie
Newbie
Avatar

Joined: 14 Nov 2008
Location: United States
Online Status: Offline
Posts: 12
Quote johnkret Replybullet Topic: Suppressing row with zero value
     Posted: 30 Mar 2009 at 12:47pm
I have a report that summarizes work order data. I have a companion sub-report that summarizes the amount of work order hours documented.

Report 1 totals Work Orders types Performed.
Report 1A (Subreport)  totals Hours Documented under Work Order types.

I would like to suppress the row in a report if the sum of the columns is equal to all zeros. So for example for Report 1 I have a work order type Special Projects that has no work orders. However for Report 1A Special Projects there are 2.0 hours of documented times. I would to suppress the row from Report 1 but not from Report 1A. I would like to see a line for Special Projects showing  nothing in the columns for Report 1 but having 2.0 hours of documented time.

If both report have no data in the columns I would like to suppress the entire row (Reports 1 & 1A)

Is there  a way to do this?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 Mar 2009 at 6:28am
it all depends on how the report is set up. If the subreport's size on the main report is just a cell, and the main report value to suppress is just a cell, something like SPECIAL PROJECTS   xxxxx.xx (main) xxxxx.xx (subreport), it should be easy....
 
go into the format field for the main report and on the general tab select the suppression formula button.  to start: {table.field} = 0
 
You should be able to do the same for the subreport...in the subreport I would create a shared variable that would report the total amount being reported back by the subreport.  Use the shared variable as the trigger in the suppression of the subreport.  For the row, go to the section expert and click the suppression formula for the section desired and enter both criteria in the formula editor.   join the 2 statements with an AND as you want to suppress the row when both the main and the subreport are 0.
 
I realize that this is pretty general, but there a lot of unknowns in how the report is formatted and what you want to accomplish, but this should give an outline of one method to accomplish the task.
IP IP Logged
johnkret
Newbie
Newbie
Avatar

Joined: 14 Nov 2008
Location: United States
Online Status: Offline
Posts: 12
Quote johnkret Replybullet Posted: 31 Mar 2009 at 7:59am
Here's an example
       WO Open  |  WO Requested | WO Completed| Hours(subreport)| %
Admin    1                2                        1                          5            
Correct  0                0                        0                          0
PM         0                0                        0                          2
New       0                1                        1                          0

What I like is to eliminate the Correct group with no blank line between Admin & PM.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Apr 2009 at 6:15am
in subreport, add a formula like:
shared numbervar totHours := the total value that is being displayed
 
in the section expert for the section that Correct is in for the suppression formula:
 
shared numbervar totHours;
 
totHours=0 and {wo open}=0 and {wo requested}=0 and {wo completed}=0
 
As for each item being suppressed if it is 0, just go to format field/general tab/ suppress button
the field will change, but the logic is the same for all of the fields
{field to suppress} = 0
for the subreport field, it would be:
shared numbervar totHours = 0
 
hope this helps
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