0

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.

crystalnoob
  • 27
  • 1
  • 8
  • 1
    what is your problem and where are you struck? – Siva Aug 17 '16 at 09:00
  • 1
    Make a summary of invoice distinct sum – Furtiro Aug 17 '16 at 10:55
  • The subreport treats each invoice as a group. If I use count then, using my example, I get 1, 2, and 1. If I use distinct then I get 1, 1, and 1. The distinct is accurate, but I then want to count or sum those results and see 3. Putting the count in the report footer doesn't work either. Seems to count the invoice for each group. – crystalnoob Aug 17 '16 at 16:06
  • Making a summary and putting the field in the footer returns 1, 1, and 1. – crystalnoob Aug 17 '16 at 16:37

1 Answers1

1

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.
DBB
  • 137
  • 1
  • 4
  • Is this done using the SQL Expression? If so I have not used that feature. What are "n" and "tbldemo"? Are they the column and table I want to use in my count? Is there any special syntax? – crystalnoob Aug 17 '16 at 16:08
  • n which holds an individual reference for each object of the tbldemo.Yes tbldemo is table. – DBB Aug 19 '16 at 04:42