Sample Schedulable User Labor Billing Report with Grand Total


#1

(compatible with AyaNova v3.3.3.0 and higher)

Got another sample report template - this is a modification of the existing Sample Schedulable User Billing Report from the Labor grid in the Service navigation pane.

Sample Schedulable User Billing Report with Grand Total

Download and extract, and import into AyaNova. Report will display for selection from the Labor grid in the Service navigation pane.

With this report, it still displays grouped by the schedulable user in Labor the quantity of No Charge hours, Billable hours, combined, and the Net Total for each schedulable user just as it did with the Sample Schedulable User Billing Report also provided in this forum, but with additional. (do check out the info on the Schedulable User Billing report as it provides information on how that report was initially created)

Have added so that it provides a Grand Total at the bottom of the report - Grand Total of all No Charge Quantity, Grand Total of all Billable Hours, Grand Total of all NC & Billable combined, and a Grand Total of all net labor charges.

To perform this, I referred to other sample report templates to determine the scripts that would be used. For example, I looked at the scripts in the Sample Client Total Billable report template.

.

I recommend downloading and importing the report template, open it in custom report designer, and follow along by selecting the properties where indicated so that you can see how done.

First off, I added additional variables where the running totals would be kept. I opened the existing script in the ReportHeader band OnBeforePrint script property and added the variables for GrandTotal, GrandNCQty, GrandTotalQty, andGrandNCBillableQty - note that the NCBillTotal variable was already there from the previous sample report template

//This creates the variable NCBillTotal and sets its initial value to 0
System.Decimal NCBillTotal = 0;
System.Decimal GrandTotal = 0;
System.Decimal GrandNCQty = 0;
System.Decimal GrandTotalQty = 0;
System.Decimal GrandNCBillableQty = 0;
private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
}

Than in the GroupFooter1 band is where the net total fields are.

Select xrTableCell4 (shows in the design panel as Sum ([No Charge Quantity]) ) and view the properites of this field
Expand the Scripts property
You will now see that there is a script in the OnSummaryCalculated script property

Here I entered a script takes the value of this field, converts it to decimal, and places it into the running total for GrandNCQty

private void OnSummaryCalculated(object sender, DevExpress.XtraReports.UI.TextFormatEventArgs e)
{
if(e.Value != null)
GrandNCQty += Convert.ToDecimal(e.Value);
}

Did the same with the field xrTableCell5 (shows on design panel as Sum ([Service Rate Quantity]) except that the running total is the GrandTotalQty

Did the same with the field xrTableCell6 (shows on design panel as Sum ([Net]) except that the running total is the GrandTotal

With field xrTableCell8, as it isn’t bound to an actual data field because it is a combination of the two fields NC Qty and Service Rate Quantity, the script is placed in the OnAfterPrint script so that after the amount is displayed in this field, it is than converted to decimal and placed in the running total for the GrandNCBillableQty

I than created a new ReportFooter band on the Sample Schedulalbe User Billing report by right clicking on the reportHeaderBand1, selecting Insert band… ReportFooter

I created the new table - top row with labels to identify the fields below.

In field xrGrandNCQty, I added the OnBeforePrint script to take the GrandNCQty running total and format it as a regular number and place it as text into this field xrGrandNCQty

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

Did the same for the field xrGrandBillableQty, xrGrandNCBillableQty and xrGrandTotal - each getting the runnig total for their appropriate fields.

Did a menu Save As which created this new report.

  • Joyce