Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Problem writing a handler for a report with a request-page

(1) ShareShare
ReportReport
Posted on by 2
Hi!

I'm testing MS Dynamics Nav (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-testing-application). I have a problem writing a handler for a report with a request-page that is run before the report starts to execute. On the request page need to specify a parameter for the report, after which the report is printed.  A request page has a predefined set of buttons: OK and Cancel, there are no others.

I would like to save the report to a file.

1. If I use the request page handler, I cannot use the method Report.SaveAsPdf, an error occurs: The TestPage is not open (it makes sense, because after selecting the settings on the request page, it was closed).

2. If you use the method Report.Save As in the request page handler (having previously intercepted the generated xml), an error occurs indicating that the parameters selected on the request page were not applied or most likely reset.

3. If the request page handler does not attempt to save the report in any way, an error occurs: User interface without processing: ReportData

The documentation (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-requestpagehandler-attribute) states: If you create a ReportHandler method, then that method replaces all code for running the report, including the request page, and a RequestPageHandler is not called. Only create a RequestPageHandler method if you are not using a ReportHandler one.

Can you tell me how to work with the request pages in the report handler to select the necessary parameters?
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 13,278 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 76,221 Super User 2024 Season 2 on at
    Problem writing a handler for a report with a request-page
    Hi, there is a way to add a button on the Request Page, hope that gives you some hints.
    Dynamics 365 Business Central: How to add “actions (buttons)” on Request Page of Report/XMLport
     
     
    Thanks.
    ZHU

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,904 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans