Is it possible to sum filtered rows?

Stimulsoft Reports.NET discussion
Post Reply
misiek_1984
Posts: 3
Joined: Wed Feb 10, 2010 2:36 am

Is it possible to sum filtered rows?

Post by misiek_1984 »

Hello

I have a report in which I use filters. At at the same time I want to calculate sums of chosen columns taking into account all rows - visible in the report and filtered. I spend some time trying to do it but I did not find solution.

Michał Komorowski
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Is it possible to sum filtered rows?

Post by Jan »

Hello Michał,

You can use following expression:

Code: Select all

Totals.Sum(DataSource, Expression)
Thank you.
misiek_1984
Posts: 3
Joined: Wed Feb 10, 2010 2:36 am

Is it possible to sum filtered rows?

Post by misiek_1984 »

Thanks for the replay but I forgot to write that I use grouping in my report and I need one sum per group. The structure of report is as follow:

MyGroupHeaderBand
MySum
--- MyDataBand

In MyDataBand I need to use filters. The value of MySum depends on the current group however it should take into account rows filtered by MyDataBand. If it is possible I can hide the rows in some way insted of using filters.

Michał Komorowski

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Is it possible to sum filtered rows?

Post by Edward »

Hi Michał,

Please use the following expression for grouping:

Totals.Sum(GroupHeaderBand, Expression)

Some rows you could disable in the BeforePrintEvent of the DataBand.

Please open attached report in the Demo.exe sample application.

Thank you.
Attachments
333.TotalsGroupExpressions.mrt
(18.86 KiB) Downloaded 399 times
Post Reply