Report grouping

KaitsuKaitsu Member Posts: 22
I have two tables T1 (header) and T2 (lines) and they are linked.
Can I group all the lines in report with one field in T2 table?
I guess not without creating temporary table for it. NAV just groups T2 records inside T1 record when using GroupTotalFields, right?

Comments

  • ara3nara3n Member Posts: 9,256
    yes, T2 will be grouped within T1.
    You'll need a temp table.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • KaitsuKaitsu Member Posts: 22
    Ok, thanks.
    I have another question.
    Design window looks like this now:

    Table 1
    --Table 2
    Temp table

    Because I do not need key fields of the tables in report the temp table has running number as key field so it looks something like this:

    1 ID (running number)
    2. T1.field1
    3. T1.field2
    4. T2.field1
    5. T2.field2

    Rows for this table are generated in Table 2 OnAfterRecord trigger.

    Looks like I cannot set 'Temporary' property in temp table to 'Yes' like you can when you have temporary table record variable in View/Globals or Locals. Is it possible that report gets messed up when multiple users run it at the same time?
  • ara3nara3n Member Posts: 9,256
    You need to use Interger Record. Create Global variable temprecord and store the data.

    In On predataitem of Interger record add

    Setrange(Number,1,TempRecord.count);


    onaftergetrecord

    if Number = 1 then
    TempRecord.findfirst
    else
    TempRecord.next;
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.