Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Custom Counters in Group Header and Footer Not Accurate... Expand / Collapse
Posted Monday, September 8, 2008 12:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, October 19, 2008 10:49 PM
Points: 1, Visits: 3

I am creating a payroll report that has a group for collecting all the hours worked by an employee on a particular day. In the group header, I have a custom function that zeros the hour counters for regular, overtime, holiday, and leave time. In the detail row, I have a custom function that increments each of these kinds of time, but does not print out any values. In the group footer for the day, I have a function that properly calculates the regular and overtime hours, and they return a string so the final values can be printed. All of these functions work great outside of SSRS, so I know that they are working properly. Now, here is the rub...

At the start of a day, the counters are all properly set to zero in the group header.
At the end of the day, when the group footer runs my calculate functions, it seems to be running the zeroing functions in the header and my output is always zero. ??? ??? ??? I thought that this was strange, but figured that I could simply add a second group footer line for the day and reset the counters to zero AFTER the first group footer did it calculations and output its values, but that did not work...

I would really appreciate your help in understanding why my counters are not working properly... Is there a evaluation special evaluation order for the group header, detail, and group footer? Once I get the daily counters working, then I must repeat the process for weekly and report totals.

Thanks for your help!

Post #565234
Posted Monday, September 8, 2008 11:54 AM


Group: General Forum Members
Last Login: Today @ 11:24 AM
Points: 2,678, Visits: 3,542
I don't know about the evaluation order, but why are you having to use any kind of fancy calculations? If you perform your query correctly, there's no reason to have to worry about how to sum a given column. I suspect that you are "on to" the nature of the problem, but getting past evaluation order probably is NOT the right way to fix the problem. Relying on evaluation order is a time-bomb just waiting for a data or structural change, or maybe even a simple change of server hosting the report.

Also, it's hard for anyone to help you very much when you've provided no details on the query that feeds your report, as we have no idea what you're results look like nor even any idea what the data is. Understandably, payroll data brings privacy issues to the forefront, but a set of "not real" test data and the actual query could be a lot more useful in helping you than a question on evaluation order.

(aka smunson)

(aka sgmunson)

Health & Nutrition
Post #565652
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse