Time Log Report
Posted: Thu Jan 26, 2012 9:14 pm
I'm new to the forum, and new to Stimulsoft in general. I have experience with Crystal Reports, but little with code writing. I'm struggling a bit with how to create calculated values and then use them for further calculation. In Crystal it seemed easier to create a Formula Field, and then use that Formula Field to perform further calculations. I've done a little with the variables, but I'm not getting the results I need. Hopefully I'm missing something.
In the attached report, I need to take raw time data, and calculate the total hours worked. The time needs to be rounded forward to the next 15min interval at the beginning of the day after a 5 minute grace period. Same at the end of the day in reverse. Then if the total is greater than 5 hours, a 30minute lunch needs to be deducted to calculate the payable hours. Since there can be multiple log-ins, I grouped by the day, then took the min and max time values as the start and end of the day.
I was looking for a floor function like in crystal with a multiple that I could use for this, but since I couldn't find that, I took the time value and multiplied it out to find the serial time value, in other words the number of seconds into the day. Then I took that value for the login time, subtracted 5x60 seconds, then with some multiplication and the ceiling command, I found the next 15minute interval. Then I converted that back into an actual time value. Then did the same for the end of the day, and calculated the difference. If the difference was greater than 5 hours, subtracted the 30min lunch and came up with the value. In the end, this got me the total time between the calculated start and end time for each group.
First, I'm curious if there was a better way to do that, since these formulas are very cumbersome for anyone else to figure out or modify.
Second, I need the total for each employee to show in another Group Footer, based on the lengthy formula, and I can't seem to get that to work.
Any help would be greatly appreciated.
Report and PDF
Thanks
Tim S.
In the attached report, I need to take raw time data, and calculate the total hours worked. The time needs to be rounded forward to the next 15min interval at the beginning of the day after a 5 minute grace period. Same at the end of the day in reverse. Then if the total is greater than 5 hours, a 30minute lunch needs to be deducted to calculate the payable hours. Since there can be multiple log-ins, I grouped by the day, then took the min and max time values as the start and end of the day.
I was looking for a floor function like in crystal with a multiple that I could use for this, but since I couldn't find that, I took the time value and multiplied it out to find the serial time value, in other words the number of seconds into the day. Then I took that value for the login time, subtracted 5x60 seconds, then with some multiplication and the ceiling command, I found the next 15minute interval. Then I converted that back into an actual time value. Then did the same for the end of the day, and calculated the difference. If the difference was greater than 5 hours, subtracted the 30min lunch and came up with the value. In the end, this got me the total time between the calculated start and end time for each group.
First, I'm curious if there was a better way to do that, since these formulas are very cumbersome for anyone else to figure out or modify.
Second, I need the total for each employee to show in another Group Footer, based on the lengthy formula, and I can't seem to get that to work.
Any help would be greatly appreciated.
Report and PDF
Thanks
Tim S.