Reputation: 403
I am trying to get the value of a field that is populated based on a parameter and use it to calculate a sum. I believe the way to do this is to use a custom summary. I noticed devexpress has GetCurrentRow and GetCurrentColumn methods but I do not see a method that will just take the value of that field (in my case xrTableCell43) and allow you to use it in calculations. For example:
I have a report section that looks like this
2001 | 2
2002 | 4
2003 | 3
2004 | 1
2005 | 4
Rem 6
Tot 20
However I have put a parameter in my report which allows the user to select a year to drill through to. So if they click on 2002 the report will look like this:
Q1 | 1
Q2 | 1
Q3 | 0
Q4 | 2
2002 | 4
Rem 6
Tot 20
This all works perfectly. It is the Rem field that I am trying to fix. In this case, the Rem field should be 14 because it should subtract 2002 and previous years from the total. xrTableCell43 has the sum of the year clicked and all previous years. How do I write Tot - value of xrTableCell43 in code so that this result is shown in xrTableCell13?
Upvotes: 1
Views: 2898
Reputation: 298
As you say, it looks like a good job for custom summary events. To get the value of a specific field, use the function GetCurrentColumnValue.
Upvotes: 1