Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppressing some values in a record Post Reply Post New Topic
Author Message
kunimitsu
Newbie
Newbie


Joined: 10 Dec 2010
Location: Canada
Online Status: Offline
Posts: 1
Quote kunimitsu Replybullet Topic: Suppressing some values in a record
     Posted: 10 Dec 2010 at 4:01am
Hi All,
 
I have just started Crystal Report only for a week. Can anyone teach me how to do the following:
 
Here's part of my data
 
staffid  payid  hrswrkd  unitid  distamnt
 
    2      120       40        hrs     2000
    2      120       40        hrs     1000
    2      121       10        hrs      500
    2      121       10        hrs      300
 
Total hours       100      hrs     3800
 
I would like to suppress the value that are in bold, but keeping the values that is not bold. Also the total hours should only be 50 hours instead of 100 hours. Can anyone help me on this?
 
Thank you very much
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 10 Dec 2010 at 4:20am
From your example I'm guessing you want to suppress duplicates?

http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=4821



The short way is to just right-click the fields, then "format field" select the "common" tab and check "suppress if duplicate"

The long way I guess would be writing a formula

1. Open formula editor
2. expand the "formatting formulas" folder
3. expand "details"
4. right-click on the specific field and add a "new formatting formula".
5. select "suppress if duplicate"
6. {field} = Previous({field})

This checks if the current record is the same as the previous record and suppresses it accordingly.

I looked around and found a way to have it sum only unsuppressed values, which can be accomplished by

1: create a new running total
2: select the field that you want to summarize
3: for evaluate, create a formula that is the direct opposite for the suppression formula
4: for reset, you want to "change on a group" if you have multiple groups.

For step 3, since you are suppressing if duplicate, you can just change the = to a <> and that will check if it is NOT a duplicate.

Note that I'm basing it on XI so I don't know if other versions have different steps or even support it.



Edited by Keikoku - 10 Dec 2010 at 5:00am
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