[RESOLVED] Crystal Reports 11 - Determining duplicate records?
I have a crystal report that is called from a VB.Net application. The application actually sets the selectionformula (see below)
Code:
strSelectionCriteria = "{tblBatchHeader.rowID} = " & mRowID & " and " & _
"{tblBatchDetail.grossGallons} <> 0 and " & _
"{tblBatchDetail.netGallons} <> 0"
crDOC.RecordSelectionFormula = strSelectionCriteria
Duplicate Records are allowed on this report, however, we now need to identify them for easier readability by placing an "*" at the end of the detail line. I would like to be able to do this using formulas but I'm not sure how to do this. There are 3 fields on the report that determine if a record has duplicates. I'm thinking I need to incorporate these 3 fields into some kind of formula. Any ideas?
Thanks in advance,
Re: Crystal Reports 11 - Determining duplicate records?
You can use the Next or Previous functions to read the field values of the next or previous record. The formula would then compare the current record with the next/previous record.
Code:
If Previous({table.field1}) = {table.field1} And Previous({table.field2} = table.field2 Then
"*"
Else
""
Re: Crystal Reports 11 - Determining duplicate records?
You da man brother!!!!
That worked perfectly!
Thanks Bruce
Re: [RESOLVED] Crystal Reports 11 - Determining duplicate records?
Hi Bruce,
I did have one concern about this solution. The Previous() function...does this mean any record within the returned Dataset or literally the previous record of the printed report?
Thanks,
Re: [RESOLVED] Crystal Reports 11 - Determining duplicate records?
It would be the "previous record of the printed report".
For example, if the Dataset is sorted by EmployeeId but the report is sorted by EmployeeName, then printing Previous(EmployeeId) would not result in a sequential display of the ids.
Re: [RESOLVED] Crystal Reports 11 - Determining duplicate records?
Thanks Bruce, that helped!