Workorder total time report

Hi,

I need to create a report for each closed workorder that will show the total time taken from the moment the workorder was created to the moment it was closed. Is it possible? My guess is that the Service Date in the workorder header would be the start date. What about the close date? Does it get created when I close the workorder? If so, where can I find that close date? Thx.

Hi

A suggestion may be to use the Record Last Modified field in a detailed report template -as whenever you modify a service workorder, that field gets updated. And once you checkmark the Closed field ina workorder, you can not modify the workorder any more so it could be the closed date.

Of course, if you log in as the AyaNova Administrator and uncheck the Closed, and then Close it again, do note that the Last Modified Date will be changed - so kept that in mind.

Or another suggestion is to use the Labor’s Service Stop Date & Time field.

Or if you do not necessarily complete service for a workorder the same day you check the Closed field ofthe workorder or you have multiple Labor items in a workorder that all have different stop date/times, you might want to use another date field such asthe Close By Date field so you specifically set the date and time closed.

Also the example report template on subtracting dates.

Also check out the sample detailed type report template installed with AyaNova for use with the Service Workorder grid and Items gridSample Labor from Request Date Average Response Time as it too shows an example of the scripts you can refer to in the Before Print script for the Detail1 band and Before Print script for the Report Footer band.

Or if you would like me to create this custom report for you, or create a custom script for you, send details as per Custom-report-templates and I would be happy to quote for you.

  • Joyce

I fallowed your sample but I’m getting nothing but zeros. I used the same script to calculate total hours spent but it looks like my dt1 and dt2 values are not being read properly. I’m attaching this test report. If you could take a look at it and tell me where the problem is I’d appreciate it.

Hi Mospan, I will download and take a look and get back to you what I find.

  • Joyce

Hi again Mospan

0 was being returned because the GetColumnValue needed to be identified as getting the data for the detailReportBand1

Edit your script so that it includes the detailReportBand1, save and now preview.

  • Joyce

That was it Joyce, thank you. Happy New Year to you. :slight_smile:

Hi Joyce,

Turns out it wasn’t all. Maybe you could help me with this. I added one more section called “Report Summary” but can’t get very far with it. Also, I wanted to change “Format String” on xrLabel3 to “n” or “XXX.00” but i’m not able to save it. Please advise. Thank you.

mospan (1/4/2010)Hi Joyce,
Turns out it wasn’t all. Maybe you could help me with this. I added one more section called “Report Summary” but can’t get very far with it. Also, I wanted to change “Format String” on xrLabel3 to “n” or “XXX.00” but i’m not able to save it. Please advise. Thank you.

Hi Mospan

If wanting to format a string that is actually a number of the total hours derived from such a script, I did a search online and found this web page that gave example to use http://www.csharp-examples.net/string-format-double/- so would use:

xrLabel3.Text = String.Format(“{0:0.00}”, ts.TotalHours);

(previously you had xrLabel3.Text = ts.TotalHours.ToString(); which just converted the ts.TotalHours to a string, whereas the above line converts to a string that is formated with two decimal points 0.00).

If you would like me to create custom scripts to determine your Report Summary fields, I would be happy to do so. Let me know, and I will send you a quote to your email address. Otherwise, a suggestion would be to do a search through existing posts for similar, as well as searching online for C# formatting and scripting examples etc, but providing this would be outside our free support.

  • Joyce

Thank you Joyce, I appreciate it. Let me talk to few people here and find out. If anything I’ll get back to you. Thx.