web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to set a value to the Request filter in a report?

(0) ShareShare
ReportReport
Posted on by 4,188

Hi,

The requirement is such that on a button click on customer page, an email containing the report in a .pdf file will be sent to the customer.Now here the report has request page with request filter as No. 

I run my runrequest page for the user to enter start date and end date but No field is left blank. The request paramneters are saved as xml parameters and then using stream email is sent. Here I want No to be set as the customer No.

I tried using tha function and setting it onPreDataitem but it didn't work. any suggestions?

Capture11.JPG

8780.Capture12.JPG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Not sure if I have well understood but if the report has Customer table as sourceexpression you can pre-filter the Customer table and then pass the record as SetTableView to the report.

    A second possible way (more elegant) is to create a function in the report itself for setting the Customer No. So you can call YouReport.SetCustomerNo('XXX') and in then in this report function set the filter accordingly.

  • Verified answer
    Andrey Baludin Profile Picture
    3,941 on at

    Hi!

    Create report variable Report50011

    Report50011.SETTABLEVIEW(CustomerTable);
    XmlParameters := Report50011.RUNREQUESTPAGE();
    
    //your code
    
    Report50011.SAVEAS(XmlParameters, REPORTFORMAT::Pdf, Ostream);


  • Suggested answer
    CDsilva Profile Picture
    4,188 on at

    Hey Steffano,

    I tried with second option of creating a function but it didn't work.

    SETTABLEVIEW worked perfectly. Thank you Andry and Steffano

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans