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



not adding correctly Expand / Collapse
Author
Message
Posted 7/14/2006 11:05:02 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 3/6/2007 1:34:52 PM
Posts: 43, Visits: 136
using the detail by client report i am getting incorrect hours totals.

ie a clients total on summary is 24.75 but in the detailed report i am getting 20.75 .

the report is showing all hours just not calculating .

Post #1702
Posted 7/14/2006 11:47:26 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: Today @ 7:01:14 PM
Posts: 1,700, Visits: 4,007
Hi Randy

Thank you for sending the report template. I am looking at this report template right now, and as it will take a bit to go through all the changes you have done on this report, I will get back to you as soon as possible.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #1704
Posted 7/14/2006 2:41:28 PM
AyaNova Sales & Support

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

Group: Administrators
Last Login: Today @ 7:01:14 PM
Posts: 1,700, Visits: 4,007
Hi Randy

A lot of changes had been made to the original sample report template -  I have attached a further customized report template based on the original sample report template as I wasn't quite sure I had got all the changes that were adversely affecting the outcome.

You had removed TaxA and Tax B from the labor Net totals, and added Billable Hours and NC Quantity, but did not configure the Properites or scripts for these added fields so that they would total at the end of each client, and the final totals were based on group sums - so some fields were summing and others were not.


What I did:

I took the original Sample Total Billable for Workorders Grouped by Client and customized further:

- I edited the margins as was edited in your previous custom report template.

- I set the Detail1 for the DetailReportItemLabor band property of Visible to True, and added the additional fields you had in your custom report template

- added the Serial Number datafield into the Detail for the DetailReportItem band

- In the script for the reportHeaderBand1 have added the following to identify that these are decimal fields so we can use them to total up all workorders and workorder items for a client. These were added to those that were already there.

decimal TotalQty = 0;
decimal TotalNC = 0;

-Have also added the following to the script for the GroupFooter1, which in escense zero's them out each time before another client's information is printed.

TotalQty = 0;
TotalNC = 0;

- added additional Net fields to display in the GroupFooter2 for the DetailReportItemLabor band - to display the sum of Service Rate Quantity and the sum of No Charge Quantity for that workorder item. Note these datafields are set to Group Sum as this sums up the labor quantity for that workorder item.

- Now because I want to do the same as with the other summed fields for labor - in that I want to keep a running total of these fields to total up at the bottom for this client, if I select the field xrTableCell70 which is Sum([Net]), select Properties, exapand Scripts, I will see that there is a script for OnSummaryCalculated. If I open the script editor, I see that for this field it is :

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

As I would want to do a similar script for the Sum ([Service Rate Quantity]) datafield I've copied this (as its already laid out for me), select the field xrTableCell2 which is for Sum ([Service Rate Quantity]), select Properties, expand Scripts , open the script editor for OnSummaryCalculated and replaced with above, but edited NetLabor to TotalQty

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


Than I did the same for the xrTableCell4 which is the Sum ([No Charge Quantity]) datafield

- Now for the complete total at the bottom of the report template, I added additional fields to display in the GroupFooter1 area of the entire report where we display the complete totals of all workorders and workorder items for the client. Note that just like the other fields in the GroupFooter1 - these are NOT datafields - they use scripts to obtain the totals that have been adding up from the Net Totals above in the report template.

Named one of them xrTotalQty and the other xrTotalNC

To see how the other fields were obtaining their data, I selected xrNetLabor viewed its Properties, expanded Scripts and identified that there is a script for it for OnBeforePrint which I opened that has:


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


So therefore, I selected xrTotalQty field I had made, opened script editor for OnBeforePrint, copied this into it and edited to be for the xrTotalQty field and to format not for currency but just to strip out trailing zero's

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


I than did the same for the xrTotalNC field.

- Now this report template includes summing up labor hours and no charge hours for every workorder item, as well as totaling those sums at the end for the client - using as example the scripts that were already in the report template for the other fields.

[support note: please refer to the section http://forum.ayanova.com/Forum103-1.aspx to obtain a sample Total Billable report template]

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #1706
Posted 7/16/2006 10:15:38 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 3/6/2007 1:34:52 PM
Posts: 43, Visits: 136
thanks for all the work . can i send you a bounty for correcting my errors.

randy

Post #1714
« 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 8:08pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 8 queries. Compression Disabled.