|
-
Mar 31st, 2008, 11:42 AM
#1
Thread Starter
PowerPoster
[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,
-
Mar 31st, 2008, 01:03 PM
#2
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
""
-
Mar 31st, 2008, 01:16 PM
#3
Thread Starter
PowerPoster
Re: Crystal Reports 11 - Determining duplicate records?
You da man brother!!!!
That worked perfectly!
Thanks Bruce
-
Mar 31st, 2008, 02:03 PM
#4
Thread Starter
PowerPoster
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,
-
Mar 31st, 2008, 02:57 PM
#5
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.
-
Mar 31st, 2008, 03:10 PM
#6
Thread Starter
PowerPoster
Re: [RESOLVED] Crystal Reports 11 - Determining duplicate records?
Thanks Bruce, that helped!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|