Sample report template displaying individual tax totals at bottom of report

Here is a further customization of the Sample Detailed Service Workorder with Grand Total report template - an AyaNova user had requested help as they only have one tax (am using Tax B only and referring to it as VAT) and in the report template they wish each indivdual tax total to display at the bottom of the report (i.e Total Part Tax separate from Total Labor Tax etc)

If you would like to see how this was done, download the sample report template, import and refer to each of the steps below while viewing the report template in the designer:

Sample Report with Indivdual Tax Totals Using Tax B Only

(AyaNova 6 and higher download AyaNova 6 Sample Report with Indivdual Tax Totals Using Tax B Only)

  1. Added to the existing OnBeforePrint script for the ReportHeader1 to include the variables for each of the individual taxes we will be keeping a running total of for the bottom of the report template, and commented out the existing NetTaxA and NetTaxB dir=ltr " ">

decimal NetLaborVAT = 0;
decimal NetPartVAT = 0;
decimal NetTravelVAT = 0;
decimal NetLoanVAT = 0;
decimal NetMiscVAT = 0;

//decimal NetTaxA = 0;
//decimal NetTaxB = 0;

  1. In the original Sample Detailed Service Workorder with Grand Total in each GroupFooter for each band (Labor, Parts, Travel, Loans and Misc Exp), there was a summary displaying the group sum of Tax A and summary displaying the group sum of Tax B. The fields referring to Tax A were removed from each of these GroupFooters.

  2. Select the data field for displaying the Tax B group sum in the Labor’s GroupFooter2 (field xrTableCell35), and edited the existing OnSummaryCalculated script for this field to instead keep a running total to NetLaborVAT instead of to NetTaxB

  3. Did the same for the data field for Tax B for Part, Travel, Loan and Misc Expense - editing the OnSummaryCalculated script to use the appropriate variable i.e NetPartVAT, netTravelVAT etc

  4. In the ReportFooter1 properties, edited the OnBeforePrint to comment out the variables NetTaxA and NetTaxB as no longer used

  5. Added new table fields in the ReportFooter1 band for the additional label fields to display tax for Labor, specific tax for Parts, etc

  6. Added new script OnBeforePrint for each of these new fields to obtain the displayed amount for NetLaborVAT, NetPartVAT etc - if you select for example, the field xrTableCell92 (field under the field labeled Net Labor VAT), and view the OnBeforePrint script you will see that it has the script dir=ltr " ">

private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
xrTableCell92.Text = string.Format("{0:c2}", NetLaborVAT);

  1. Print previewed the report and ensured no error messages. Saved the report.

This sample report template is provided to assist those that may want to edit other report templates summaring totals at the bottom of a detailed report template.