Group footer values keep changing
I have a calcuation in a textbox referencing a custom code calculation. It grabs a hospital episode length of stay, if Rownumber = 1, and keeps a running total. This is a workaround for the Crystal Reports Running Total Fields functionality which allows
a running total to be evaluated on a group - with multiple groups this is very helpful. By using the above approach I can get the results needed by am having weird responses at runtime.
For example, say I have a 19 page report created. If I use the BIDS report viewer and use the Next Page control to scroll through the whole report then the group footer results are correct. If I use the Last Page control then the group
footer results only report a much small value. If is scroll back and forth between pages and then look at the group footer results then I keep getting an ever increasing number. It is almost as if the report is constantly evaluating the cell reference
expressions and updating the final group footer results.
This is the detail line textbox code:
=Iif(Rownumber("prcae_refno") = 1, Code.ResetRunvalue(Fields!prvsp_actual_los.Value, Rownumber("prcae_refno")), Nothing)
And this is the custom code funtion:
Public shared sum_actual_los as int32=0
Public Function ResetRunvalue(Byval los as int32, Byval rownum as string)
If rownum = "1" then
sum_actual_los = sum_actual_los + los
End If
' return sum_actual_los
End Function
This is the group footer textbox code:
=Code.sum_actual_los
May 4th, 2011 10:01pm
Hi,
You can try like
SUM(Fields!prvsp_actual_los.Value,"Group Name") if you want to display the total for the group.
Please mark as answer if this post helps.
Thanks,
Shobhit
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2011 11:08pm