SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Custom Counters in Group Header and Footer Not Accurate...


Custom Counters in Group Header and Footer Not Accurate...

Author
Message
azabc2
azabc2
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 3
Hello,

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!

Mike
sgmunson
sgmunson
SSCertifiable
SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)

Group: General Forum Members
Points: 6864 Visits: 4369
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.

Steve
(aka smunson)
SmileSmileSmile

Steve
‌(aka sgmunson)
Smile Smile Smile
Health & Nutrition
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search