Start a report with filter problem.

kirkostaskirkostas Member Posts: 127
Hi,
I have a table with only one key, "No." and I have a header/detailed form on that table.
I have created a menu button to call that report.
Even if I use the properties to call it or call it from code, I can't call it with filter in the "No."
I have the "No." value REP-1000 and I want to print only this record.

1st Example: Properties "RunObject" "Report 50000"
2nd Example: Code REPORT.RUNMODAL(50000,True,False,Rec);

I tried to create a local variable on that table, SETRANGE it from REC and pass it to REPORT.RUNMODAL but didn't work too.

This is not the first time I am doing this, I have done it before w/out having any problem.

Why is this happening to me? Is it a bug?
kirkostas

Comments

  • kinekine Member Posts: 12,562
    you need to use SETRECFILTER to set the rec filter and pass it to the REPORT. But you need to do it over some other variable than rec else you will end with filter set on the form...

    something like:
    myVar := REC;
    myVar.SETRECFILTER;
    REPORT.RUNMODAL(Report::"ReportID",TRUE,TRUE,myVar);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kirkostaskirkostas Member Posts: 127
    Thanks it worked.
    kirkostas
Sign In or Register to comment.