Results 1 to 6 of 6

Thread: [RESOLVED] Crystal Reports 11 - Determining duplicate records?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Resolved [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,
    Blake

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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
      ""

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Reports 11 - Determining duplicate records?

    You da man brother!!!!

    That worked perfectly!

    Thanks Bruce
    Blake

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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,
    Blake

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: [RESOLVED] Crystal Reports 11 - Determining duplicate records?

    Thanks Bruce, that helped!
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width