Multiple GroupTotals in a report

Hi All, I have to amend a report to show more than one group total and I’m not having much success. The report I have to amend reads the Sales Invoice Line dataitem and grouptotals on Item Number only. The user now wants to grouptotal on Product Group Code aswell as Item and I dont know how to do this. The construction of current report is as follows. Reads Sales Invoice Line with properties of Sorting on No. and GroupTotaFields of No. Sections are SIL Header 1, SIL Header 2,SIL Body 3 with nothing in it, SIL GroupFooter 4 with Item, description, Qty etc in it and SIL Footer 5 with some totals. Could someone please tell me how I should construct the report to subtotal on Product Group Code as well as Item within the Product Group Code. Thanks for your help… Paul

First you need a new key with “Product Group Code”,“No.”. Then you need to use that key in your report. You need to add the “Product Group Code” to the Group Total fields. Easiest would be to create a new report with the sortings you want and check the code and properties of that. There is an important TOTALSCAUSEDBY or so which detects if a certain GroupHeader or GroupFooter section should be printed or not.

Hi Paul If you do not want to create a new key, another modification to track then, another Way you could approch this is from the top down. Create a Report on the Item Table, a grouping report, with the Key “Product group”, the “No.” filed becomes the secondary Index. Product Group “No.” DAIRY 11000 DAIRY 12000 DAIRY 12003 FRESH 10001 FRESH 10002 Then Indent Your “Sales Line” Table with one of the keys Document Type,Type,No.,Variant Code,Drop Shipment,Shipment Date or Document Type,Type,No.,Variant Code,Drop Shipment,Shortcut Dimension 1 Code,Shortcut Dimension 2 Code,Location Code,Bin Code,Shipment Date Add “No.” to the GroupTotalFields on the Sales Line DataItem Create you DataItemLink to the Item Table, and you can use your flowfilters for Variant, Dims 1 and 2 and date filter to Shipment date if you require it, and set the Item ShowOnlyIfDetail to Yes. this will skip any Items with No Sales Lines. then on the Item C/AL Code, say which fields from the Sales Line you want totals for Item - OnPreDataItem() CurrReport.CREATETOTALS(SalesLine.Amount,SalesLine.“Amount (LCY)”); On your Report GroupFooter drop in a textbox with the Source Expresion set to SalesLine.Amount, or which ever field you want. You will have to Add a Group Header and Footer for the Sales Line Item No. CurReport.TOTALSCAUSEDBY(“No.”); I made a post last week about this subject, with a step by step walk through, you can find it here If you get stuck MSN me or call.

Hi Thomas/David, thank you both for the info I will give it a go and if I get stuck I will MSN you David. Thanks again to both of you for your invaluable help. Paul