Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Suppress matching records Post Reply Post New Topic
Author Message
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Topic: Suppress matching records
    Posted: 14 Jul 2014 at 9:57am
CR 10 Pro, SQL 2008 database
How do I configure the formula below to ignore certain matching records (tblsolog.logreason = bereavement or workers comp) but print everything else?

-- Current formula --

WhilePrintingRecords;
NumberVar L1PTOMinutes;
NumberVar PrintHours;
NumberVar PrintMinutes;


PrintHours := Truncate ((L1PTOMinutes) / 60);
PrintMinutes := Remainder ((L1PTOMinutes), 60);

Else If ((PrintHours = 0) and (PrintMinutes = 0)) then "0:00"
                 else ToText ((PrintHours), 0) + ":"
                        + (If ((PrintMinutes) > 9) then ToText ((PrintMinutes), 0)
                                else "0" + ToText ((PrintMinutes), 0))
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Jul 2014 at 5:47am
why not in the object format, conditionally suppress it with logic like:
{tblsolog.logreason}="bereavement" or
{tblsolog.logreason}="workers comp"

or if this is the only item on the line, you could suppress the whole section in Section Expert.

The hard part is altering any aggregates like AVG or SUM as they probably shouldn't contain values that are not displayed.

For that you would need a running total (not my baliwick...DBlanks) or used shared variables to keep track of the values that you want/need for your aggregates. In which case you would alter your above logic to not add the the hours and minutes to some total.

HTH
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 24 Jul 2014 at 6:02am
There are other formulas in this detail section, so I want to suppress in this formula but then display only those records in a separate formula.

Basically, I'm attempting to display the following

1. Regular hours < 40
2. OT hours > 40
3. Other hours = the 2 I'm attempting exclude in OT hours
4. Total hours
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 25 Jul 2014 at 4:58am
ok. you can suppress the output by either hiding the formula conditional or setting it to 0, you don't need to hide the section.

Altering the Aggregates is another story and will take more work.
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 28 Jul 2014 at 12:05pm
I really appreciate your help but the report had other formulas that I previously missed which made this adjustment fairly easy.
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.031 seconds.