Question

I've this report enter image description here

  1. Here I make the first sum because I've grouped values from each month (months are "Gennaio", "Febbraio", "Marzo" etc etc.). These values are hidden, but anyway I get the sum and I display the sum for each month.

  2. Then I should make the second sum that use values for each month and display the total for each category. Categories are "TOTALE LAVORI RESTAURO", "TOTALE LAVORI EDILE" etc.)

  3. This is the final sum, where I sum values from each category.

Everything is working well, but now I have to add a "month" parameter to the report that returns sums until a selected month. This parameter changes the sum 1 with this expression:

=Sum(IIf(Fields!mese.Value <= Parameters!mese.Value, Fields!costi.Value, 0))

Now, how should I change expression in SUM2 and SUM3 to work with this parameter?

If I copy that code, ther returns #Error and as far as I know I can't use ReportItems sum.

So any suggestion?

Was it helpful?

Solution

SUM #1 could remain Sum(Fields!costi.Value) because you need to display every months. i.e.: display GIUGNO even if Parameters!mese.Value = 4 (APRILE).

So you have only to change SUM #2 and #3 because TOTALE LAVORI RESTAURO and TOTALI must show only costi from GENNAIO to Parameters!mese.Value; i.e. if Parameters!mese.Value = 4 display only GENNAIO-APRILE even if we have details about GIUGNO.

The expression gave error because you have NULL value in Fields!costi.Value or Fields!mese.Value: convert this value to zero in your DataSet and you won't have problems.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top