Values into FilterFields if a report is being printed

dstiegeledstiegele Member Posts: 10
edited 2004-07-09 in Navision Attain
Hi,
I need to fill out some requested filter fields so that they contain values if the user is opening/starting the report. This works if the report is being defined as a local variable and is started with RUNMODAL.

But I need to fill in these values if the report is being printed from the form 282, "Report Selections". Is there any point/trigger from where I can modify the requested filter fields so that they are filled in when the user opens this report?

Thanks in advance!

Dirk Stiegele

Comments

  • AfonsoAfonso Member Posts: 27
    Hi,

    I don'k know which values do you want to put on the report, but i leave here some ideas that might work:

    To show the last non printed record of a table, create a boolean field in that table witch you modify each time you run the report;

    To show some information related to the user, you can create a field on the table 91 containing the next/last information to show on the report.


    Regards

    Afonso
  • dstiegeledstiegele Member Posts: 10
    Hi,

    thanks for your help. But what I am asking for is how to fill some of the requested filter fields with values, so that they contain this value when the user opens this report to print it from within the form 282, "Report Selections".

    Thanks!

    Dirk Stiegele
  • AfonsoAfonso Member Posts: 27
    I understood what you want, but if you can record the information that you want to apply on the filters on thoose tables, you can get the information available on the tables and apply on the report as soon as you open it...

    Regards...

    Afonso
  • afarrafarr Member Posts: 287
    Dirk,
    there is a solution by sv at:
    http://www.navision.net/forum/topic.asp?TOPIC_ID=11267

    Alastair
    Alastair Farrugia
  • RobertMoRobertMo Member Posts: 484
    This solution suggest exactlly what he doesn't want to do. Still it can be used. Change button Print:OnPush on F282:
    CurrForm.SETSELECTIONFILTER(TempReportList);
    ReportSelectionPrint.Start(TempReportList);
    
    to
    IF "Report ID" = REPORT::"My Report" THEN BEGIN
      MyRec.SETRANGE(MyField1,Filter1);
      MyRec.SETRANGE(MyField2,Filter2);
      MyReport.SETTABLEVIEW(MyRec);
      MyReport.RUNMODAL;
    END ELSE BEGIN
      CurrForm.SETSELECTIONFILTER(TempReportList);
      ReportSelectionPrint.Start(TempReportList);
    END;
    

    For more reports use CASE statement
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • dstiegeledstiegele Member Posts: 10
    Hi,

    that's what I am looking for.
    Do I need to declare a local variable for MyRec and MyReport or what was your intention?

    Thanks!

    Dirk
  • RobertMoRobertMo Member Posts: 484
    As you wrote in your question, you know how to set some required filters if the report is declared as local var.

    My intention was that you use "this way of setting filters", but on proper trigger. MyRec and MyReport should be defined as locals (or globals), but defined for report ID you want to run ...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • dstiegeledstiegele Member Posts: 10
    Thank you. It now works!

    Regards,

    Dirk
Sign In or Register to comment.