Temporary Table in report

stevensteven Member Posts: 5
Hi all
There is some way to lunch report with REPORT.RUN and to say it to work on a temporary table?
Es:REPORT.RUN(IDREPORT,FALSE,TRUE,recItem2)
recItem2 is a RECORD Item but declared temporary!

Thanks in advance

Comments

  • PhennoPhenno Member Posts: 630
    steven wrote:
    Hi all
    There is some way to lunch report with REPORT.RUN and to say it to work on a temporary table?
    Es:REPORT.RUN(IDREPORT,FALSE,TRUE,recItem2)
    recItem2 is a RECORD Item but declared temporary!

    Thanks in advance

    No, as far as I know.

    But, you can through report function, send temporary var/record to report (with VAR parameter checked on input parameters of function).
    Than, in that function you should transfer all records from that temp record to another temp record that is declared in global section of that report (with a Loop or however you want).

    after that you can use Integer var for looping through your temp record in report.

    sounds complicated but it isn't, though, somebody else could have simplier solution.
  • kinekine Member Posts: 12,562
    See tip&tricks...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    Create an Function in your Report where you fill (or give them <- Call by Reference Variable (VAR) on this solution you need an second global variable TempTab2, be sure that this variable is temporary) the temporary table.

    As DataItem u use "Integer"

    Code in PreDataItem()

    TempTab.reset;
    setrange(numer,1,TempTab.count);

    Then in the AfterGetRecord()
    if Numer = 1 then
    TempTab.find('-')
    else
    TempTab.next;

    .
    .
    .



    In The body Sections (Also Header,Footer, etc.) of Integer you give out the datas from the TempTab.

    But when you need the grouping function, you must write some lines of code.

    So, if you fill the TempTab not in the Report you must write this:

    //Here you fill you TempTab

    YourReportAsVariable.SetTempTab(VAR TempTab);
    YourReportAsVariable.userequestform(false); <- if you not need the Request form
    YourReportAsVariable.run;

    If you fill the TempTab in the Report

    YourReportAsVariable.FillTempTab(Your Parameters if you need one);
    YourReportAsVariable.userequestform(false);
    YourReportAsVariable.run;

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.