Solved

Suppress Duplicate Records Crystal Reports

Posted on 2011-02-28
10
880 Views
Last Modified: 2012-05-11
Hi

I have a sub-report that has 4 formulas and want to suppress a record if it is duplicated.  For example this is one of the formulas:
if  {ACC_REPORT_DP_S.FLAG_RANGE} = "H" then "H:High"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "L" then "L:Low"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "HP" then "HP:High Panic"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "LP" then "LP:Low Panic"

When the report is run it can display H: High many times I only want to display it once.  Is there a way to suppress duplicate records when using a formula/

Any help is greatly appreciated.

0
Comment
Question by:nobile00
  • 5
  • 4
10 Comments
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997495
There are a couple ways, depending on what you're trying to accomplish.  One is to create a running total that counts details, and suppresses when the counter is > 1 and {ACC_REPORT_DP_S.FLAG_RANGE} = "H".  Another way is to group by {ACC_REPORT_DP_S.FLAG_RANGE}, and only print the group header, not the details.
0
 

Author Comment

by:nobile00
ID: 34997539
I tried grouping but that didn't work.  There are 4 formulas that have the same type formula but are coming from 4 different fields in the database.  The other formulas are for flag too.  Would I be able to use a counter with the 4 formulas?
0
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997555
Most likely.  What does those formulas look like?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:nobile00
ID: 34997608
Here are the other 3 formulas:

1. if {ACC_REPORT_DP_S.FLAG_ALERT} = "A" then "A:Alert"
2. if {ACC_REPORT_DP_S.FLAG_EXCLUSION} = "E" then "E:Exclusion"
3. if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dp+" then "Dp+: Positive Delta from Previous Visit"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dp-" then "Dp-: Negative Delta from Previous Visit"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db+" then "Db+: Positive Delta from Baseline"
else if {ACC_REPORT_DP_S.FLAG_DELTA} =  "Db-" then "Db-: Negative Delta from Baseline"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dbp+" then "Dbp+: Postive Delta from Baseline and Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dbp-" then "Dbp-: Negative Delta from Baseline and Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db+Dp-" then "Db+Dp-: Positive Delta from Baseline and Negative Delta from Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db-Dp+" then "Db-Dp+: Negative Delta from Baseline and Positive Delta from Previous"

0
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997853
Those are vanilla formulas, they won't interfere with anything.   Make a simple running total that counts occurrences of any field in the detail record, then in the detail sections suppression formula put '{#myrunningtotal} > 1 and {ACC_REPORT_DP_S.FLAG_RANGE} = "H"'.  Just be sure to reset the running total at an appropriate sort break.
0
 

Author Comment

by:nobile00
ID: 34997984
Also, there can be duplicates for any of the records not just High it could have multiples of Low LowPanic etc. I not sure the above will work I will give it a try.
0
 
LVL 12

Accepted Solution

by:
JayConverse earned 500 total points
ID: 34998062
Then you could have four formulas like this:

HCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "H" then 1 else 0;
LCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "L" then 1 else 0;
LPCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "LP" then 1 else 0;
HPCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "HP" then 1 else 0;

Then create 4 running totals that sum each of the Count fields.  Then your suppression formula would be more like:

{#myrunningHtotal} > 1 or {#myrunningLtotal} > 1 or {#myrunningLPtotal} > 1 or {#myrunningHPtotal} > 1
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34998444
Is this for the entire report or do you have the data grouped in some way?

Are you suppressing just the display of that value or the display of the entire record based on 1 or more fields?

mlmcc
0
 

Author Comment

by:nobile00
ID: 34999083
Thanks for checking in MLMCC the above solution from Jay worked.  
0
 

Author Closing Comment

by:nobile00
ID: 34999089
Jay this worked a little bit tedious but overall it worked.

Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question