Work Order Report Problems

Hello,

First, please keep in mind I am completely new to this. I am trying to create / modify my own detailed workorder report (I have attached it). Where my first problem is; I am trying to add labor lines. I ca do this, however, it displays only the first line repeatedly, no matter how many lines are in the work order. Make sense? I have read the sample detailed workorder tutorial - AND I AM MISSING SOMETHING! Please help me!

Many thanks!

Hi Joshua

Thank you for attaching a copy of the report template - that allows me to see right away what is happening so that I can post a sugestion/solution for you right away too.

You have done a really nice job of this report template, but it is not that you are missing something, it is that you have bound the fields in your report designer panel to the incorrect dataset in a “Detailed” work order report template Fields list

I’m not sure if you were originally referring to the “Tutorial on making a detailed workorder report” for AyaNova version 3 from http://forum.ayanova.com/Topic1298-103-1.aspx(if not, id using version 3 go to that link and download the tutorial and refer to it along with my next info)

Go to Step #37 in this tutorial - from here forward it refers to ensuring that you select from the topmost dataset and its own sub-datasets WorkrderHeader only. Ignore the other datasets listed underneath that are labeled “WorkorderItem”, “WorkorderItemLabor” etc - because of the way the report designer works, we have to have those there, but if you select datafields from them as youhave done, your report will perform as yours is.

Here is an example of what you need to edit on every datafield in the design panel in the workorder item band Detail and the labor band Detail1

OK!

I see! Thank you very much. Worksgreat. Now for my next question. I am trying display and calculate the parts, labor and sales tax in the Report Footer. I looked at the sample and I cannot get it to work… Any suggestions?

Thank you

Hi again Joshua

Great to hear above helped.

Not sure what to suggest as not sure what it is that you are having a problem with specifically. I would recommend re-looking at the sample report template working backwards from the script of the datafield that displays the final amount up through the scripts of the other fields that accumlate the tax total for that last datafield.

  • Joyce

Hi again Joshua

If you are referring to the Sample Detailed Workorder with Grand Total for example the field xrNetTaxA field in the ReportFooter1 band, if you expand the Scripts property for this field, you will see that it has a OnBeforePrint script of

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

What that script is doing is taking the accumulated amount in the NetTaxA and formatting it to display as a string and placing it in the xrNetTaxA field as text

If you work your way up the design panel in each of the groupfooter bands, for example, click on the xrTableCell118 in GroupFooter5 in the DetailReportItemLoan band which is for the Tax A sum for all loan items, open its Scripts properties, you will see that it has a script in the OnSummaryCalculated of

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

And if you go to the next band above that, in the GroupFooter4 of the Misc Expense band, the field xrTableCell100 which is for the Tax A sum for all misc expenses, open its Scripts properties, you will see here too that it has a script in the OnSummaryCalculated of

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

Continue checking each of the fields in teh design panel in the groupfooters, and you will see each of those for Tax A has a script that keeps a running total of all Tax A so that it accumulates to place the total tax A into that xrNetTaxA field in the ReportFooter1

That is how the total tax A is accumulated to show in that field in the report footer.

Also note that in the Scripts property of the ReportHeader band, that NetTaxA is declared and what its initial value is so that each workorder report is zero’d out before hand

decimal NetLabor = 0;
decimal NetTravel = 0;
decimal NetPart = 0;
decimal NetMiscExpense = 0;
decimal NetLoan = 0;
decimal NetTaxA = 0;
decimal NetTaxB = 0;
decimal GrandTotal = 0;

I do encourage you to refer to the sample report templates, and work your way backwards from the field that you want to do similar to, so that you can see how we have done the sample. If you have additional questions, do always provide specifics so that I can help.

  • Joyce