Totalling subtotals

MainahMainah Member Posts: 12
Is there an easy way to create a total for grouped subtotals. I am trying to total all entries on report 10136 Item transaction detail in Nav 3.7.

Thanks

Answers

  • SavatageSavatage Member Posts: 7,142
    assuming you want to total the ValueOhHand field
    :-k
    View Sections add a Item (FOOTER) should be 8
    Add a variable "GrandTotal" type decimal (or whatever name you want)

    on the PreDataItem of ITEM add
    OnPreDataItem()
    CurrReport.CREATETOTALS(ValueOnHand);
    
    view Sections & on
    OnPostSection() if Item Ledger Entry, footer 7
    GrandTotal := GrandTotal +ValueOnHand;
    
    Add a textbox in the item footer8 with sourceexp = grandtotal
    OBJECT Report 10136 Item Transaction Detail
    {
      OBJECT-PROPERTIES
      {
        Date=12/05/02;
        Time=11:19:12 AM;
        Modified=Yes;
        Version List=NAVUS3.01;
      }
      PROPERTIES
      {
        CaptionML=ENU=Item Transaction Detail;
        OnPreReport=BEGIN
                      CompanyInformation.GET;
                      ItemFilter := Item.GETFILTERS;
                      ItemLedgerFilter := "Item Ledger Entry".GETFILTERS;
                    END;
    
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table27;
            PrintOnlyIfDetail=Yes;
            OnPreDataItem=BEGIN
                            CurrReport.NEWPAGEPERRECORD := PrintOnlyOnePerPage;
                            FromDate := GETRANGEMIN("Date Filter");
                            ToDate := GETRANGEMAX("Date Filter");
                            CurrReport.CREATETOTALS(ValueOnHand);
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF ItemLedgerFilter = '' THEN BEGIN
                                 SETRANGE("Date Filter",0D,FromDate - 1);
                                 CALCFIELDS("Net Change");
                                 QuantityOnHand := "Net Change";
                                 ValueEntry.SETRANGE("Posting Date",0D,FromDate - 1);
                                 COPYFILTER("Location Filter",ValueEntry."Location Code");
                                 COPYFILTER("Variant Filter",ValueEntry."Variant Code");
                                 COPYFILTER("Global Dimension 1 Filter",ValueEntry."Global Dimension 1 Code");
                                 COPYFILTER("Global Dimension 2 Filter",ValueEntry."Global Dimension 2 Code");
                                 ValueEntry.SETRANGE("Item No.","No.");
    
                                 IF NOT ValueEntry.SETCURRENTKEY(
                                   "Item No.","Posting Date","Entry Type","Item Ledger Entry Type","Item Charge No.",
                                   "Location Code","Variant Code","Global Dimension 1 Code","Global Dimension 2 Code","Expected Cost")
                                 THEN
                                   ValueEntry.SETCURRENTKEY(
                                     "Item No.","Posting Date","Entry Type","Item Ledger Entry Type","Item Charge No.",
                                     "Location Code","Variant Code","Expected Cost");
    
                                 ValueEntry.CALCSUMS("Adjusted Cost");
                                 ValueOnHand := ValueEntry."Adjusted Cost";
                               END ELSE BEGIN        // If the user enters any filters for Item Ledger Entries,
                                QuantityOnHand := 0; // the balance to date fields (Qty and Value on Hand) can
                                ValueOnHand := 0;    // never contain the correct values. Therefore, we just
                               END;                  // set them all to zero.
    
                               SETRANGE("Date Filter",FromDate,ToDate);
                             END;
    
            ReqFilterFields=No.,Search Description,Date Filter,Bill of Materials,Inventory Posting Group,Statistics Group;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=1692;
              }
              CONTROLS
              {
                { 1001;Label        ;0    ;0    ;7500 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Inventory Transaction Detail }
                { 1002;TextBox      ;14700;0    ;2250 ;423  ;HorzAlign=Right;
                                                             SourceExpr=FORMAT(TODAY,0,4) }
                { 1003;TextBox      ;17100;0    ;1050 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TIME;
                                                             Format=<Hours12>:<Minutes,2> <AM/PM> }
                { 1004;TextBox      ;0    ;423  ;7500 ;423  ;SourceExpr=CompanyInformation.Name }
                { 1005;Label        ;16950;423  ;750  ;423  ;ParentControl=1006;
                                                             HorzAlign=Right }
                { 1006;TextBox      ;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                             SourceExpr=CurrReport.PAGENO }
                { 1007;TextBox      ;16650;846  ;1500 ;423  ;HorzAlign=Right;
                                                             SourceExpr=USERID }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (ItemFilter <> ''));
                             END;
    
              }
              CONTROLS
              {
                { 8   ;TextBox      ;0    ;0    ;18150;423  ;SourceExpr=Item.TABLECAPTION + ': ' + ItemFilter }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (ItemLedgerFilter <> ''));
                             END;
    
              }
              CONTROLS
              {
                { 7   ;TextBox      ;0    ;0    ;18150;423  ;SourceExpr="Item Ledger Entry".TABLECAPTION + ': ' + ItemLedgerFilter }
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND
                                                     ((ItemLedgerFilter <> '') OR
                                                      (ItemFilter <> '')));
                             END;
    
              }
              CONTROLS
              {
              }
               }
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=1269;
              }
              CONTROLS
              {
                { 9   ;Label        ;600  ;0    ;1200 ;846  ;ParentControl=22;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 10  ;Label        ;3600 ;0    ;1200 ;846  ;ParentControl=23;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 11  ;Label        ;4950 ;0    ;1800 ;846  ;ParentControl=24;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 15  ;Label        ;11400;0    ;1500 ;846  ;ParentControl=28;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 16  ;Label        ;16950;0    ;1200 ;846  ;ParentControl=29;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 4   ;Label        ;1950 ;0    ;1500 ;846  ;ParentControl=3;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 6   ;Label        ;9750 ;0    ;1500 ;846  ;ParentControl=5;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 14  ;Label        ;13050;0    ;1800 ;846  ;ParentControl=13;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 27  ;Label        ;15000;0    ;1800 ;846  ;ParentControl=26;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 25  ;Label        ;8100 ;0    ;1500 ;846  ;ParentControl=12;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 55  ;Label        ;6900 ;0    ;1050 ;846  ;ParentControl=54;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 17  ;TextBox      ;0    ;0    ;1800 ;423  ;HorzAlign=Left;
                                                             FontBold=Yes;
                                                             SourceExpr="No." }
                { 18  ;TextBox      ;1950 ;0    ;4200 ;423  ;FontBold=Yes;
                                                             SourceExpr=Description }
                { 1   ;TextBox      ;7050 ;0    ;1500 ;423  ;HorzAlign=Left;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Unit:;
                                                             SourceExpr="Base Unit of Measure" }
                { 2   ;Label        ;6300 ;0    ;600  ;423  ;ParentControl=1;
                                                             FontBold=Yes }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter = '');
                             END;
    
              }
              CONTROLS
              {
                { 19  ;TextBox      ;11400;0    ;1500 ;423  ;ParentControl=28;
                                                             DecimalPlaces=2:5;
                                                             BlankZero=Yes;
                                                             SourceExpr=QuantityOnHand }
                { 36  ;TextBox      ;6600 ;0    ;4650 ;423  ;LeaderDots=Yes;
                                                             SourceExpr=STRSUBSTNO(Text000,FromDate) }
                { 37  ;TextBox      ;15000;0    ;1800 ;423  ;ParentControl=26;
                                                             BlankZero=Yes;
                                                             SourceExpr=ValueOnHand }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 1000000002;TextBox;15000;0    ;1800 ;423  ;FontBold=Yes;
                                                             SourceExpr=GrandTotal }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table32;
            DataItemTableView=SORTING(Item No.,Variant Code,Drop Shipment,Location Code,Bin Code,Posting Date);
            OnPreDataItem=BEGIN
                            IF NOT SETCURRENTKEY("Item No.","Variant Code","Drop Shipment","Global Dimension 1 Code",
                                                 "Global Dimension 2 Code","Location Code","Bin Code","Posting Date")
                            THEN
                              SETCURRENTKEY("Item No.","Variant Code","Drop Shipment","Location Code","Bin Code","Posting Date");
                            CurrReport.CREATETOTALS(Quantity,"Adjusted Cost");
                          END;
    
            OnAfterGetRecord=BEGIN
                               CALCFIELDS("Adjusted Cost","Adjusted Cost (Expected)");
                               IF "Invoiced Quantity" <> Quantity THEN
                                 "Adjusted Cost" := "Adjusted Cost (Expected)";
    
                               IF ItemLedgerFilter = '' THEN BEGIN
                                 QuantityOnHand := QuantityOnHand + Quantity;
                                 ValueOnHand := ValueOnHand + "Adjusted Cost";
                               END;
                               ItemPrice := Amount / Quantity;
                             END;
    
            ReqFilterFields=Entry Type;
            GroupTotalFields=Variant Code;
            DataItemLink=Item No.=FIELD(No.),
                         Variant Code=FIELD(Variant Filter),
                         Location Code=FIELD(Location Filter),
                         Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),
                         Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),
                         Posting Date=FIELD(Date Filter);
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=TransHeader;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter = '');
                             END;
    
              }
              CONTROLS
              {
                { 20  ;Label        ;6600 ;0    ;4650 ;423  ;LeaderDots=Yes;
                                                             CaptionML=ENU=Balance Forward }
                { 21  ;TextBox      ;11400;0    ;1500 ;423  ;ParentControl=28;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=QuantityOnHandCF }
                { 38  ;TextBox      ;15000;0    ;1800 ;423  ;ParentControl=26;
                                                             SourceExpr=ValueOnHandCF }
              }
               }
            { PROPERTIES
              {
                SectionType=TransHeader;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter <> '');
                             END;
    
              }
              CONTROLS
              {
                { 39  ;Label        ;6600 ;0    ;3000 ;423  ;LeaderDots=Yes;
                                                             CaptionML=ENU=Balance Forward }
                { 40  ;TextBox      ;9750 ;0    ;1500 ;423  ;ParentControl=5;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=Quantity }
                { 41  ;TextBox      ;13050;0    ;1800 ;423  ;ParentControl=13;
                                                             SourceExpr="Adjusted Cost" }
              }
               }
            { PROPERTIES
              {
                SectionType=GroupHeader;
                SectionWidth=18150;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CLEAR(ItemVariant);
                               IF "Variant Code" = '' THEN
                                 CurrReport.SHOWOUTPUT(FALSE)
                               ELSE
                                 CurrReport.SHOWOUTPUT(ItemVariant.GET("Item No.","Variant Code"));
                             END;
    
              }
              CONTROLS
              {
                { 33  ;TextBox      ;300  ;423  ;2700 ;423  ;SourceExpr=STRSUBSTNO(Text002,"Variant Code") }
                { 34  ;TextBox      ;3150 ;423  ;6450 ;423  ;SourceExpr=ItemVariant.Description }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=846;
                OnPostSection=BEGIN
                                QuantityOnHandCF := QuantityOnHand;
                                ValueOnHandCF := ValueOnHand;
                              END;
    
              }
              CONTROLS
              {
                { 22  ;TextBox      ;600  ;0    ;1200 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Posting Date" }
                { 23  ;TextBox      ;3600 ;0    ;1200 ;423  ;CaptionML=ENU=Entry Type;
                                                             SourceExpr="Entry Type" }
                { 24  ;TextBox      ;4950 ;0    ;1800 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Document No." }
                { 28  ;TextBox      ;11400;0    ;1500 ;423  ;CaptionML=ENU=Quantity on Hand;
                                                             DecimalPlaces=2:5;
                                                             BlankZero=Yes;
                                                             SourceExpr=QuantityOnHand }
                { 3   ;TextBox      ;1950 ;0    ;1500 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Location Code" }
                { 5   ;TextBox      ;9750 ;0    ;1500 ;423  ;DecimalPlaces=2:5;
                                                             BlankZero=Yes;
                                                             SourceExpr=Quantity }
                { 13  ;TextBox      ;13050;0    ;1800 ;423  ;BlankZero=Yes;
                                                             SourceExpr="Adjusted Cost" }
                { 26  ;TextBox      ;15000;0    ;1800 ;423  ;CaptionML=ENU=Value on Hand;
                                                             BlankZero=Yes;
                                                             SourceExpr=ValueOnHand }
                { 29  ;TextBox      ;16950;0    ;1200 ;423  ;SourceExpr="Entry No." }
                { 12  ;TextBox      ;8100 ;0    ;1500 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Source No." }
                { 54  ;TextBox      ;6900 ;0    ;1050 ;423  ;SourceExpr="Source Type" }
                { 1000000000;TextBox;12900;423  ;1800 ;423  ;SourceExpr=Amount }
                { 1000000001;TextBox;15750;423  ;1500 ;423  ;SourceExpr=ItemPrice }
              }
               }
            { PROPERTIES
              {
                SectionType=TransFooter;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter = '');
                             END;
    
              }
              CONTROLS
              {
                { 30  ;Label        ;6600 ;0    ;4650 ;423  ;LeaderDots=Yes;
                                                             CaptionML=ENU=Balance to Carry Forward }
                { 31  ;TextBox      ;11400;0    ;1500 ;423  ;ParentControl=28;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=QuantityOnHandCF }
                { 42  ;TextBox      ;15000;0    ;1800 ;423  ;ParentControl=26;
                                                             SourceExpr=ValueOnHandCF }
              }
               }
            { PROPERTIES
              {
                SectionType=TransFooter;
                SectionWidth=18150;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter <> '');
                             END;
    
              }
              CONTROLS
              {
                { 43  ;Label        ;6600 ;0    ;3000 ;423  ;LeaderDots=Yes;
                                                             CaptionML=ENU=Balance to Carry Forward }
                { 44  ;TextBox      ;9750 ;0    ;1500 ;423  ;ParentControl=5;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=Quantity }
                { 45  ;TextBox      ;13050;0    ;1800 ;423  ;ParentControl=13;
                                                             SourceExpr="Adjusted Cost" }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter = '');
                             END;
    
                OnPostSection=BEGIN
                                GrandTotal := GrandTotal +ValueOnHand;
                              END;
    
              }
              CONTROLS
              {
                { 32  ;TextBox      ;1950 ;0    ;4500 ;423  ;FontBold=Yes;
                                                             SourceExpr=Item.Description }
                { 35  ;TextBox      ;11400;0    ;1500 ;423  ;ParentControl=28;
                                                             FontBold=Yes;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=QuantityOnHand }
                { 46  ;TextBox      ;0    ;0    ;1800 ;423  ;HorzAlign=Left;
                                                             FontBold=Yes;
                                                             SourceExpr="Item No." }
                { 47  ;TextBox      ;6600 ;0    ;4650 ;423  ;FontBold=Yes;
                                                             LeaderDots=Yes;
                                                             SourceExpr=STRSUBSTNO(Text001,ToDate) }
                { 48  ;TextBox      ;15000;0    ;1800 ;423  ;ParentControl=26;
                                                             FontBold=Yes;
                                                             SourceExpr=ValueOnHand }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18150;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(ItemLedgerFilter <> '');
                             END;
    
              }
              CONTROLS
              {
                { 49  ;TextBox      ;0    ;0    ;1800 ;423  ;HorzAlign=Left;
                                                             FontBold=Yes;
                                                             SourceExpr="Item No." }
                { 50  ;TextBox      ;1950 ;0    ;4500 ;423  ;FontBold=Yes;
                                                             SourceExpr=Item.Description }
                { 51  ;Label        ;6600 ;0    ;3000 ;423  ;FontBold=Yes;
                                                             LeaderDots=Yes;
                                                             CaptionML=ENU=Total of Entries }
                { 52  ;TextBox      ;9750 ;0    ;1500 ;423  ;ParentControl=5;
                                                             FontBold=Yes;
                                                             DecimalPlaces=2:5;
                                                             SourceExpr=Quantity }
                { 53  ;TextBox      ;13050;0    ;1800 ;423  ;ParentControl=13;
                                                             FontBold=Yes;
                                                             SourceExpr="Adjusted Cost" }
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=3850;
          Height=440;
          SaveValues=Yes;
        }
        CONTROLS
        {
          { 1   ;CheckBox     ;3410 ;0    ;440  ;440  ;ShowCaption=No;
                                                       CaptionML=ENU=New Page per Item;
                                                       SourceExpr=PrintOnlyOnePerPage }
          { 21  ;Label        ;0    ;0    ;3300 ;440  ;ParentControl=1 }
        }
      }
      CODE
      {
        VAR
          CompanyInformation@1000 : Record 79;
          ItemLedgerEntry@1001 : Record 32;
          ItemVariant@1002 : Record 5401;
          ValueEntry@1015 : Record 5802;
          ItemFilter@1003 : Text[250];
          ItemLedgerFilter@1004 : Text[250];
          PrintOnlyOnePerPage@1005 : Boolean;
          FromDate@1006 : Date;
          ToDate@1007 : Date;
          QuantityOnHand@1008 : Decimal;
          ValueOnHand@1009 : Decimal;
          QuantityOnHandCF@1010 : Decimal;
          ValueOnHandCF@1011 : Decimal;
          Text000@1012 : TextConst 'ENU=Beginning Balance (%1)';
          Text001@1013 : TextConst 'ENU=Ending Balance (%1)';
          Text002@1014 : TextConst 'ENU=Variant: %1';
          ItemPrice@1000000000 : Decimal;
          GrandTotal@1000000001 : Decimal;
    
        BEGIN
        END.
      }
    }
    
  • MainahMainah Member Posts: 12
    I am trying to get totals of the totals based on entered filters for instance.

    Filters set: Date 110108..113008
    NO. A..C
    Entry Purchase

    Results

    Item A
    11/01/08 Purchase 10
    11/15/08 Purchase 10

    Total of Entries 20

    Item B

    11/2/08 Purchase 5
    11/16/08 Purchase 10

    Total of entries 15

    What I need is to total A and B
    A 20
    B 15

    Grand total of purchases is 35 for the period filtered.

    I would need it to total off of the total of entries. As this report has several filters from the Item ledger entry table that are being used. I could create a report just for purchases and use Create total from Purchases (QTY) from Items but would rather make this report wokr from the total of entries so that it would me multi functional.
  • SavatageSavatage Member Posts: 7,142
    if you want to total the qty on hand just change my suggestions above from ValueOnHand to QuantityOnHand or both.
    An I on the wrong track here
  • MainahMainah Member Posts: 12
    I really appreciate the help. I am not sure if I am being as clear as I need for my requirements. I just want this report to take all the Item subtotals and give me a grand total of all the subtotals of the report. I need to see the totals for each group but then at the end I need the total. It will give me the total count of every item that I sold or purchased as well as other adjustments but only when I filter for them.
  • SavatageSavatage Member Posts: 7,142
    edited 2008-12-05
    subtotals of what! - Value, Qty, something else?
    Did the pic not show you totalling of subtotals? I thought it did.

    Have you tried it or do you want me to create the report?
  • garakgarak Member Posts: 3,263
    edited 2008-12-05
    i doesn't know this report, but totaling is ever the same.
    So as Harry ask, what do you want to total?
    For totaling you can use the property TotalFields and the function CurrReport.createtotals(Field) in onPreDataItem and GroupFooter / GroupHeader

    Regards
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    the orig post makes it sound like it subtotals but doesn't grand total.

    I attached a sample report that totals the Value you can add qtyonhand or anyother field you want to total up.
  • SavatageSavatage Member Posts: 7,142
    This totals the purchases the vale & the qty on hand - use it as an example of how to total other fields you might be interested in totaling for this report.
    http://savatage99.googlepages.com/Repor ... ailwit.fob
  • MainahMainah Member Posts: 12
    I followed your instructions and must have done something wrong as it returned 0 even though there were entries to total.
  • SavatageSavatage Member Posts: 7,142
    the link above is to a report numbered 50062 - so if you do not have a 50062 you can import it and take a look at it without writing over the original report.

    For type Purchase i'll restart.

    Add a variable GrandTotalPurchase type decimal

    View Sections-> click On Item LedgerEntryFooter(8) hit f9
    OnPostSection() add
    GrandTotalPurchase := GrandTotalPurchase +Quantity;
    
    On the newly created Item (FOOTER) add a textbox with sourceexp = GrandTotal Purchase
  • MainahMainah Member Posts: 12
    I imported your report but received Field no 5403 is not defined in the Item Ledger Entry table.

    Do I need to setup different sourceExp for each entry type?

    If you run your report with a filter of sales will it give you a grand total for all the items that you sold for a defined date? As well as give you a subtotal of each item?
  • SavatageSavatage Member Posts: 7,142
    edited 2008-12-05
    do you received the error on import or compile? if compile - you can still look at the code to see how it's done
    Mainah wrote:
    I imported your report but received Field no 5403 is not defined in the Item Ledger Entry table.
    you might have to adjust the dataitemtableview property of the item ledger entry dataitem
    from SORTING(Item No.,Variant Code,Drop Shipment,Location Code,Bin Code,Posting Date)
    5403 is bin code. - What's you second key? try that one
    Do I need to setup different sourceExp for each entry type?

    If you run your report with a filter of sales will it give you a grand total for all the items that you sold for a defined date? As well as give you a subtotal of each item?
    I believe so!
  • MainahMainah Member Posts: 12
    Works just like you said it would. Thank you very much for your time.

    If I want to total the cost, do I do the same steps and change purchase to cost?
  • SavatageSavatage Member Posts: 7,142
    Mainah wrote:
    Works just like you said it would. Thank you very much for your time.
    If I want to total the cost, do I do the same steps and change purchase to cost?
    you don't have to change it - you can add a new variable like:
    GrandTotalCost or GrandTotalValue or GrandTotalQuantity, etc

    totaling any field you want.

    Adding the cost

    new Variable called GrandTotalCost

    OnItem Ledger Enter Footer (8) (view sections)
    OnPostSection()
    GrandTotalPurchase := GrandTotalPurchase +Quantity;
    GrandTotalCost := GrandTotalCost + "Adjusted Cost"; <<add!

    on the footer add a new textbox with GrandTotalCost as the source exp.
  • MainahMainah Member Posts: 12
    I must be missing your hint about add! near Adjust cost as I am getting a syntax error.
  • SavatageSavatage Member Posts: 7,142
    are you finding this section??
    OnItem Ledger Enter Footer (8) (view sections)

    can you see the c/al code already there
    OnPostSection()
    GrandTotalPurchase := GrandTotalPurchase +Quantity;

    add this, is "Adjusted Cost" the name of the field you want to total?
    GrandTotalCost := GrandTotalCost + "Adjusted Cost";

    Here's an updated report
    http://savatage99.googlepages.com/Repor ... htotal.fob

    I'm must be in a giving mood today! :mrgreen:
  • garakgarak Member Posts: 3,263
    Harry, you should take a little bit mony ;-)
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    Naa - It's friday & apparently Sinterklaas!!! \:D/
  • MainahMainah Member Posts: 12
    Harry,

    Thank you very much for your time and patience on this report.
Sign In or Register to comment.