Good morning,
I have created a new report with 4 dataitem indented
Manufacturer -> Item -> Purch. Inv. Line -> Purch. Inv. Header
In Purch.Inv. Line footer I show the totals of quantity and amount grouped by Type,No.,Item Category Code and it is ok.
I Item Group footer section grouped by Item Category Code I would like to show the totals for Item Category Code.
I inserted code in trigger Purch. Inv. Line, Footer (2) - OnPostSection()
as following
gTotQuantityManufNameICC := gTotQuantityManufNameICC + "Purch. Inv. Line".Quantity;
gTotQuantityManufName := gTotQuantityManufName + "Purch. Inv. Line".Quantity;
gTotQuantityGeneral := gTotQuantityGeneral + "Purch. Inv. Line".Quantity;
but the totals are wrong.
I think that all lines of Purch. Inv. Line are summed and not only the one displayed in Purch. Inv. Line, Footer...
How can I solve?
Thank you
0
Comments
I wrote the code to export in Excel but all Purch. Inv. Line are export and not only the ones displayed in footer section that I want.
Thank you
In general I try to avoid maintaining totals manually because it gets complicated, especially if you are using TransHeader / TransFooter sections.
Have you tried putting the following code in the Item - OnPreDataItem trigger?
If we solve this, probably solve also the first one.
Thank you very much
I think you should try letting NAV calculate the sum. Otherwise you should clear the sum variables whenever the Item Category Code changes.
You should use something like this:
IF CurrReport.SHOWOUTPUT THEN BEGIN
OutputToExcel();
END;
in section Purch. Inv. Line, Footer (2) - OnPostSection() but i report are printed 4-5 lines and in Excel 1729....how is it possible?????
To help on this I think we'll need to know how you have coded your report. In which places do you have an ExportToExcel call? What sections have you used?
Thank you