An AyaNova user had customized the Sample Detailed Service Workorder with Grand Totals by deleting all the Line Totals as they wanted only the Net Totals to display, and than they wanted only a total of all the Net Totals to display in the report Footer.
Because these samplereport templates use scripts to maintain a running total to place in the Report Footer, deleting the datafields also deleted the scripts that maintained a running total - and therefore the AyaNova user got $0 in the xrGrandTotal Field because the report template was no longer told to keep a running total.
Here is a [b]Sample Service Workorder With Net Totals Only.zip[/b]
(AyaNova 6 and higher please download [b]AyaNova6NetTotalsOnly.zip[/b]
I invite you to download, extract using WinZip, import into your AyaNova database, and follow along:
-
Open the report template in design mode (select the Print drop down, hold SHIFT key, and select the report template)
-
Select the ReportHeader band, select Properties tab for it, and expand the Scripts property.
You will see that there is a script in the OnBeforePrint script
I have edited this script to include to define the object NetWOTotal as a decimal number, and set it initially at 0
You will also see other fields identified in here that are and were used in this report template. -
Select the Detail3 of the DetailReportItemLabor band, select Properties tab for it, and expand the Scripts property
You will see it has a script for OnBeforePrint
Part of this script is to maintain a running total of the Net amount for all labor items adding them into the NetWOTotal -
Select the Detail4 of the DetailReportItemTravel band, select Properties tab for it, and expand the Scripts property
Again, see that there is a script in the OnBeforePrint script
As above, this includes code to continue adding to the object NetWOTotal all net values from Travel items -
Do the same for the Part Detail band, the Misc Expense Detail band and the Loan Detail band.
-
Now select the field xrNetWOTotal, select the Properties tab for it, and expand the Scripts property
It has a script for OnBeforePrint that takes this running total that has been added to NetWOTotal, formats it as a string so it can be displayed, and places it in this xrNetWOTotal field -
Now select the ReportFooter1 band, select Properties, expand Scripts
You will see that in here there is a script to reset the objects that were identified in the ReportHeader to 0 - to zero out before a new report is made for a new workorder.
When editing a sample detailed report template, I do encourage you to check out the Properties of the bands and fields used.
- Joyce