AyaNova service management & work order software
AyaNova Support Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


Displaying the TimeSpan in a report via... Expand / Collapse
Author
Message
Posted 4/20/2007 11:21:07 AM
AyaNova Sales & Support

AyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & Support

Group: Administrators
Last Login: Yesterday @ 10:45:49 AM
Posts: 1,689, Visits: 3,988
The following is a further customization of the Labor grid's Sample Schedulable Users Billing Hours with Grand Totals report to include displaying the difference in hours between the Service Stop Date & Time and Service Start Date & Time - such a field may be useful in checking that the actual hours worked are entered in the Billable Hours and No Charge Hours.

Download the report template Sample Total Actual Hours Schedulable Users Billing Hours with Grand Totals report

I would suggest filtering the Labor grid by the specific user (User field) and the date you wish to report on (Service Start Date & Time using a custom filter selecting greater than a date, and less than a date such as identified in the forum topic http://forum.ayanova.com/Topic1430-100-1.aspx?Highlight=greater+than)

Example of a print preview of this report template

The field xrLabel21 script property OnBeforePrint uses the following script

private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
//this gets the object value of the Stop Date & Time
DateTime dt1 = Convert.ToDateTime(GetCurrentColumnValue("LT_WorkorderItemLabor_Label_ServiceStopDate"));
//this gets the object value of the Start Date & Time
DateTime dt2 = Convert.ToDateTime(GetCurrentColumnValue("LT_WorkorderItemLabor_Label_ServiceStartDate"));
//this subtracts the start date & time from the stop date & time
TimeSpan ts = dt1.Subtract(dt2);
//this displays the timespan in total hours (if you want to display in minutes, than change TotalHours to TotalMinutes
xrLabel21.Text =  ts.TotalHours.ToString();
}


AyaNova Sales & Technical Support
http://www.ayanova.com
Post #3035
« Prev Topic | Next Topic »

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: AyaNova Sales & Support

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 3:37am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 12 queries. Compression Disabled.