Avatar of azjz
 asked on

Does Crystal Reports automatically get rid of duplicate rows?

Hi Experts:

I have a Crystal Report that is generated from an Oracle stored procedure.  When I run the procedure on the database, I get a record that is duplicated - meaning that it returns two rows of the same data.  This is fine because it is the result I want.

However, when the run the Crystal Report I have built, it gets rid of the duplicate row and only shows one occurence of the duplicated record, not 2 occurrences.  I want my Crystal Report to show both records (even though they are duplicates).   Does anyone know if there is something within Crystal to automatically only return one row of data is the data is duplicated?  (Also, the stored procedure doesn't use "select distinct".)

Thanks experts!
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Mike McCracken

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

Thanks for the response.  It was a good suggestion.  I tried de-selecting the "Select Distinct Data for Browsing" from the File, Report Options and File, Options, Database tab.  Unfortunately, I have the same problem with duplicate record showing up only once.  Also looked at the Database menu, the Select Distinct Records option is not available because my data source is a stored procedure.

Any other suggestions would be appreciated.  Thanks.  

If the seelct distinct records doesn't do it, and you can't alter the Stored Procedure, then you can insert a group to aid in suppressing the dups.
The idea is to group on a database field or a formula, then move the fields you want to display into the group header, and suppress the details section.
The hard part is identifying what field to group on.
If you have a database field that will do it, then group on that field.
If it is more than one field that identifies a unique row, then create a formula and group on that.
The formula can look like this:

{sp_name.field1} & {sp_name.field2} & {sp_name.field3}

Add as many fields as you need to.  Make sure you use the ampersand to concatenate as it will allow for conactenation of different data types.
Mike McCracken

bd - As i read the question he wants the duplicate records however, he isn't getting them.

azjz - How do you know you aren't getting the records?

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

mlmcc:  Yes you read the question correctly.

azjz:  Don't follow my post as it won't give you what you want.

Thanks for the comments.  

mlmcc:  You are correct that I am trying to get the duplicate row to show up twice, not just once as it is right now on the report.  I know that only one row of data is coming through to the Crystal Report because only one row of data shows up when I do a "Browse Data" on the report fields.

bd:  Thanks for the input too.  However, as you state in your second post, I am trying to get the duplicate records to appear on the report, not drop the duplicate record from the report as it is currently doing.

After further investigation, it appears the problem is within the stored procedure on the server.  It does not appear to be a Crystal issue in this scenario.  However, since mlmcc came closest to answering the original question, I will award the points to him.

Thanks again for the wonderful help!  

Mike McCracken

Glad i could help

Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.