Search code examples
countcrystal-reportscumulative-sumsummarize

crystal reports count instance by group then sum


My subreport has groupings on Account ID then Invoice No. Within the Account ID I could have several Invoice No's.

For example:

Account 1234

  • Invoice 6789
  • Invoice 5432
  • Invoice 5432
  • Invoice 9999

What I want is count of invoices. Using the example I should get a count of 3. There are 3 unique invoice numbers under the account id. I have tried a running total, formulas and summary.


Solution

  • Using Distinct Keyword in sql query or linq You Can Solve This Problem.

    var data = (from n in tbldemo select n).Distinct();
    
    Now Set data to your crystal report data source. It will helps you.