Totals and TOTALSCAUSEDBY

andy76
andy76 Member Posts: 616
Hello,

I am creating a new report based on Value Entry table.
I want that all records are passed to calculate for examples cost amount but in body section I want to display only records with Adjustment = no so I write:


Value Entry, Body (3) - OnPreSection()

IF "Value Entry".Adjustment THEN
CurrReport.SHOWOUTPUT(FALSE);

I then have a section Group Footer in which the totals for amounts are good but I don't want to have the quantity about Adjustment = yes summed otherwise the total quantity are duplicated.

Is this possibile? How? With function TOTALSCAUSEDBY ?

Or do I have to write a lot of code and variables to manage sums?

Thank you

Comments

  • andy76
    andy76 Member Posts: 616
    Maybe in this case I can expose the sum of the field Invoiced Quantity (that has 0 value for adjustment = yes) in the group footer instead of Valued Quantity ?
  • BBlue
    BBlue Member Posts: 90
    You can have a decimal variable in which you store the quantities when
    Adjustment = no and maintain totals for that variable to show in the group footer.

    In OnPreDataItem of VE:
    CurrReport.CREATETOTALS(QtyAdjNo);
    

    In OnAfterGetRecord of VE:
    If NOT "Value Entry".Adjustment THEN
      QtyAdjNo := "Valued Quantity";
    
    Then show QtyAdjNo in your Group footer.


    Regards.
    //Bogdan
  • DenSter
    DenSter Member Posts: 8,307
    Why not set a filter on that field?
  • andy76
    andy76 Member Posts: 616
    I need the amount totals also for adj = yes but not Quantity duplicated.
  • Franco_Festi
    Franco_Festi Member Posts: 19
    BBlue wrote:
    You can have a decimal variable in which you store the quantities when
    Adjustment = no and maintain totals for that variable to show in the group footer.

    In OnPreDataItem of VE:
    CurrReport.CREATETOTALS(QtyAdjNo);
    

    In OnAfterGetRecord of VE:
    If NOT "Value Entry".Adjustment THEN
      QtyAdjNo := "Valued Quantity";
    
    Then show QtyAdjNo in your Group footer.


    Regards.

    I would do the same.
    I don't know the report you're writing, but it sounds easy to just handle a global variable in which you save the values you need.
  • hs_mann
    hs_mann Member Posts: 17
    Hi

    Just a question about What do you mean by Duplicated?

    Is the total for Quantity showing twice in report?

    Which columns are you using in GroupTotalFields?

    Harjot