Print Page | Close Window

"Suppress if Duplicated":

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4821
Printed Date: 28 Mar 2024 at 12:07pm


Topic: "Suppress if Duplicated":
Posted By: bwagner
Subject: "Suppress if Duplicated":
Date Posted: 17 Nov 2008 at 9:58am
I've seen a few topics on similar subjects, but not sure I found this one.
 
What I'm trying to do is if a certain value is repeated on the data list to suppress the entire row.  Here is an example how the data is set up:
 
Acct #    ID      CustName    CustPhone      DaysDlq
 
 
Since customers may have more than 1 account that is past due their account number can repeat multiple times.  What I would like to do is if the account number repeats, to suppress the entire row so that their phone only gets called once.
 
If this is possible, I'd sure like some help.
 
bw



Replies:
Posted By: BrianBischof
Date Posted: 17 Nov 2008 at 10:23am
Yes, this is possible. But first, are you sorting on the account number? You need to have these records in sequential order to make this work.
 
Crystal Reports has a property called 'Suppress If Duplicated' but it only applies to individual fields. Not the entire row. To suppress an entire row, use the PreviousValue() function to compare the current value to the previous record and if they are the same, then suppress it. This prevents dupclicate records from appearing. Here is a sample formula. Put this in the formula workshop button for the Suppress property of the Details section (using your own field names).
{table.accountnum} = PreviousValue({table.accountnum});
 
I actually cover this exact problem in Chapter 8, Advanced Formatting Techniques, of my Crystal Reports Encyclopedia book. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: skailey
Date Posted: 13 Jul 2009 at 2:04pm
Even though this wasn't for me at the time, thank you.  I was looking for this answer today.



Print Page | Close Window