Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: whileprintingrecords Post Reply Post New Topic
Author Message
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Topic: whileprintingrecords
    Posted: 01 Mar 2011 at 6:29am
I have 3 groups in my report.  Within one of the groups there is data that has 0 quanity and I don't want this group with 0 quanity to show on the report.  How can I exclude records with 0 records from my WhilePrintingRecords formula?  I have tried suppressing the data thru the section expert, but then it removes all my groups.
 
I'm a beginner with Crystal so I need as much help as possible.
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Mar 2011 at 6:32am
what is your "quantity" formula?
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 01 Mar 2011 at 6:54am
Actually the qty is not a formula.  It's directly from SQL.  The qty is the position of holdings in a stock or bond.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Mar 2011 at 7:01am
OK. I assumed it was a the whileprintingrecords formula...
why are you using a whileprintingrecords formula rather than a summary function of SUM(quantity,group)?
If you use the insert summary function then youc an do a group select statement to exclude your 0 group.
you cannot do this with other summaries (e.g. variables, running totals, whileprinting records).
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 01 Mar 2011 at 7:21am
I am using the Sum for the quantity,group, and then within the section expert I put the following statement to exclude the 0 values:
 
if {Command.qty} = 0 then True Else False
 
My thought was this would eliminate that group but it keeps the group with no values.
 
Is there a way to send you a screen shot?
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Mar 2011 at 7:30am

sorry, no files.

go into the select expert
expand it
there is a toggle option for Record Selection or Group Selection
Make it Group Selection
insert your select formula there
SUM({Command.qty},{table.groupfield})>0


Edited by DBlank - 01 Mar 2011 at 7:30am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Mar 2011 at 7:36am

couple of things,

when using group select critieria the groups will still appear in the group tree but not the report canvas
the records were included in the opriginal report so the they may be included in other other sums or counts. If they do try and  use Running Totals to exlude them.
 
Off track but...
As a general rule do not use if-then statements in the select expert, but rather stick to boolean statements...
Your "if {Command.qty} = 0 then True Else False" is the same as "{Command.qty} = 0" or to reverse it you would use
NOT({Command.qty} = 0)
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 01 Mar 2011 at 8:23am
I got it...Report/Selection Formulas/Group
 
and I entered the following formula
 
SUM({Command.qty},{@f_category1})>0
 
This works great...THANKS!!!!
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 01 Mar 2011 at 9:44am
Thanks for the tip as well.  I really appreciate it!
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.016 seconds.