Temporary table in report AND if TOTALSCAUSEDBY =

superbrugersuperbruger Member Posts: 41
edited 2004-02-04 in Navision Attain
I put data in a temporary table, and when I want to post them I use the INTEGER table to find them.

But I have to have a GroupFooter, that depent on the values in the temporary table.

IF CurrReport.TOTALSCAUSEDBY = FIELDNO(Field from the temporary table) THEN
CurrReport.SHOWOUTPUT(TRUE);

I have 2 code-fields and 2 decimal-fields in the temp.table.

If I mark an option I want to sort the data Field1, field2, with a GroupFooter for Field1.

If I dont mark the option, the sorting will be field2, and no GroupFooter.

I hope You understand what I mean?

Hope somebody can help me.

Comments

  • eromeineromein Member Posts: 589
    So... What is your question? Something not working? No idea how to start?
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • superbrugersuperbruger Member Posts: 41
    Data is in the temp table.

    How do I manage to make a groupfooter, that depends on what key I use to run through the temp-data?
  • StephenGStephenG Member Posts: 99
    You Could use two Temp tables.

    eg if you wanted to Sum Customer Ledger Entries by Customer.

    One TempTable for each Customer "TempCust" and a TempTable for the details "TempCustLedgEntry"

    Then open up the Two Tables using the DataItems with the Integer Table.

    DataItem Name
    Integer CustLoop
    ..Integer CustLedgEntryLoop

    Custloop Reads TempCust
    CustLedgEntryLoop reads TempCustLedgEntry with filtered by TempCust.

    This way by Setting the Property 'GroupTotalField' to field "Number" on Custloop you can quite easily subtotal. :)
    Answer the question and wait for the answer.
  • eromeineromein Member Posts: 589
    I don't think this piece of code
    IF CurrReport.TOTALSCAUSEDBY = FIELDNO(Field from the temporary table) THEN 
      CurrReport.SHOWOUTPUT(TRUE);
    

    will work...

    You'll have to loop the temp table with the use of a integer dataitem. Therefor you'll have to manually program the totals and the subtotals.

    do something like:
    if prevcode <> code then begin
      printtotals;
      prevcode := code;
    end;
    
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • superbrugersuperbruger Member Posts: 41
    Eromein - correct - the code don't work. That was me trying to specify what the task was.

    I found a soloution.
    I did a workaround.

    If the user want to have the subtotals, I make the subtotals when running through the data, and the store this subtotal in the temp table too.
    Then I use the "correct" key, when outputting the data.
  • eromeineromein Member Posts: 589
    nicely done! :wink:
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.