Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am giving it my best with RDLC for the first time. I am not a full time programmer, so i am struggeling a bit on getting it all done, so your help is much appriciated.

I am doing a report that contains measures grouped on 2 values:

the report has a table:

Flow | Meter | measure | diff | avg
10 L | 20 L | 20,02 L| -0,02 L |
10 L | 20 L | 20,04 L| -0,04 L | "-0,03 L"
20 L | 5 L | 5,02 L| -0,02 L |
20 L | 5 L | 5,02 L| -0,02 L | "-0,02 L"

The avg column is my problem at this stage. The rest is stored in the database and calculated in input. the avg column only needs to be there once, is calculated as an average on the diff and based on the grouping of the 2 first columns - so only on either the first or the last row of the "group"

An idea or direction any of you wise people can help me with?

What I have tried:

I have googled and watched dusins of youtube videoes, but havent found anyone with the same calculation.
Posted
Comments
[no name] 12-Aug-20 12:45pm    
By wanting an "average" on a "detail" line, you've made a simple problem hard. Averages, totals, etc. belong on a "summary / group" line if you want to get the most use out of a "report writer".
kjohansen2000 13-Aug-20 9:04am    
I missed your comment, so sorry for the reply time.

Is the hard part possible? or am i in for another approach?
kjohansen2000 13-Aug-20 9:07am    
Would it be possible to store it in data and calculate it by partition over etc.?
[no name] 13-Aug-20 23:16pm    
You pre-calculate and update the last row in the group (of your data source) with the AVG (the other rows contain zero for that field); then use zero suppression in your report field to show the same field as blank in the other rows. How you go about prepping the data depends you: VB / LINQ / SQL.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900