ReportViewer problem counting rows and totals

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am using ReportViewer and am having problems counting objects (rows) and
totals by group.

I am writing a "Check Amounts" report using Visual Studio 2005 ReportViewer
and *.RDCL. This is a local report using an object for a datasource.
I have an rdcl defined with a table.

The object contains DateTime (DateTime), Account Number (long), Transaction
Type (String) and Amount(float).
Transaction types can be "VOID", "REPRINT", "MANUAL".
The printed columns in the report match the object.

The report should print the following:
Total amounts and row count by Date/Account Number for each Type - if the
row count for the type is greater than 0. If the Type row count is 0 the
total should not print.

The end of the report should print:
Total amounts and row count for the All rows
Total amounts and row count for each all Types


The report should look something like this:
************************************************************DateTime
Account Number Transaction Type Amount

12/01/05 1:00 10 REPRINT
1000.00
12/01/05 1:15 10 VOID
1000.00

Number of REPRINTS: 1 Total REPRINTS: 1000.00
Number of VOIDS: 1 Total VOIDS: 1000.00

12/02/05 12:30 20 REPRINT
1000.00
12/02/05 12:31 20 VOID
1000.00
12/02/05 12:32 20 MANUAL
1000.00
12/02/05 12:33 20 MANUAL
1000.00

Number of REPRINTS: 1 Total REPRINTS: 1000.00
Number of VOIDS: 1 Total VOIDS: 1000.00
Number of MANUAL: 2 Total MANUAL: 2000.00

12/03/05 10:30 30 MANUAL
1000.00
12/03/05 10:45 30 VOID
1000.00

Number of VOIDS: 1 Total VOIDS: 1000.00
Number of MANUAL: 1 Total MANUAL: 1000.00

Report Totals:
Number of REPRINTS: 2 Total REPRINTS: 2000.00
Number of VOIDS: 3 Total VOIDS: 3000.00
Number of MANUAL: 3 Total MANUAL: 3000.00

************************************************************
I am having problems getting get the total amount and row count by Type. I
have read a ton of material on the MSDN wedsite and elsewhere, but can't seem
to find something close and/or figure this out.

I set up a table with a header, details and footer.
I set up a group. The group has two expressions to break by date and
account number. Here are the group expressions:
=(Year(Fields!DateTime.Value) & Month(Fields!DateTime.Value) &
Day(Fields!DateTime.Value))
=Fields!AccountNumber.Value

The grouping does break and print at the correct places. However, I am
having problems getting the totals that we are looking for.
I am having problems counting objects (rows) and totaling amounts by type
for the group.

To count rows for a Type within a group I have tried:
=Count(Fields!ReportType.Value="VOID")
=Count(Fields!ReportType.Value="MERGED", "DateAccountGroup")
=Aggregate(Count(Fields!ReportType.Value="ACH")) // cannot nest aggregate
functions
=Aggregate(Fields!ReportType.Value="ACH")// must be simple field reference
=Aggregate(Fields!ReportType.Value, "DateAccountGroup")
Error 1 The Value expression for the textbox ‘textbox59’ uses the function
Aggregate with an invalid scope parameter. The scope parameter must be the
name of a scope where all containing grouping scopes have group expressions
which are simple field references.
C:\Common.NET\QuadrantSoftware\Daytona\Banking\Report\AuditLogReport.rdlc
QuadrantSoftware.Daytona.Banking.Report

To add up all the Amounts for a type I have tried
=Sum(IIf(Fields!ReportType.Value="VOID", Field!Amount.Value,0)) // adds all
rows in group, regardless of type


I set up a table footer
=Count(Fields!ReportType.Value="ACH")
=Sum(IIf(Fields!ReportType.Value="VOID", Fields!Amount.Value,0))//

Thanks

.



Relevant Pages

  • Re: Report design and Converting a paper form to a Access Report
    ... do the problem manifests itself when each category may have ... I have a report that only produces ... it to replicate this form with only totals. ... >> left and amounts on the right. ...
    (microsoft.public.access.reports)
  • Re: Report design and Converting a paper form to a Access Report
    ... Report with the categories on the left and the amounts on the right -- the ... Report Wizard for tabular format should give you such a report. ... > Presently, my report, based on a query with totals, totals ...
    (microsoft.public.access.reports)
  • Massive data collection
    ... report with subreports to display the totals, but not sure how to show the ... totals of these reports in the same report so that I can subtract amounts ...
    (microsoft.public.access.tablesdbdesign)
  • Lookup issues
    ... customer and then one to ten account categories and amounts for each. ... separate report. ... The report only cars about the category totals, and in theory, a lookup ...
    (microsoft.public.excel.worksheet.functions)
  • Re: German paratroopers
    ... Losses in the 8th Brigade are fairly completely reported. ... killed and wounded for a total of 113 casualties, ... battalion to report losses on D-Day in that brigade. ... These postwar totals are 17 percent higher than those reported after ...
    (soc.history.war.world-war-ii)