{"title":"Report.RunRequestPage([Text]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/reportinstance-runrequestpage-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-runrequestpage-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-runrequestpage-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Runs the request page for a report without running the report.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Report.RunRequestPage([Text]) Method","slug":"reportrunrequestpagetext-method","at":0,"chars":4027},{"level":2,"title":"Syntax","slug":"syntax","at":264,"chars":88},{"level":2,"title":"Parameters","slug":"parameters","at":352,"chars":217},{"level":2,"title":"Return Value","slug":"return-value","at":569,"chars":152},{"level":2,"title":"Remarks","slug":"remarks","at":721,"chars":742},{"level":2,"title":"Example","slug":"example","at":1463,"chars":2430},{"level":2,"title":"Related information","slug":"related-information","at":3893,"chars":134}],"text":"# Report.RunRequestPage([Text]) Method\n> Version: _Available or changed with runtime version 1.0._\nRuns the request page for a report without running the report. Returns an XML string that contains the request page parameters that are entered on the request page.\n## Syntax\n```al\nReportParameters :=   Report.RunRequestPage([PageParameters: Text])\n```\n## Parameters\nReport\nType: report-data-type\nAn instance of the report-data-type data type.\n*[Optional] PageParameters*\nType: ../text/text-data-type\nA string of request page parameters as XML to use to run the report.\n## Return Value\nReportParameters\nType: ../text/text-data-type\nXML string that contains the request page parameters that are entered on the request page\n## Remarks\nThis method opens the request page for the specified report, where the user can provide parameters for the report. When the user closes the request page by choosing the OK button, a string that contains the parameter values that were set by the user is returned. When the user chooses the Cancel button, an empty string will be returned. The returned parameter string can be picked up by calling one of the following methods:\n reportinstance-execute-method\n reportinstance-print-method\n reportinstance-saveas-method\n> NOTE\n> You can use these methods to schedule reports in the job queue.\nBecause the request page runs in the context of where it was invoked from, users cannot bookmark a link to this page from the user interface.\n## Example\nThis example illustrates how to use the RunRequestPage method to run the request page for report ID 206 Sales Invoice. The request page parameters are saved to a table, and then uses the parameters with the Execute, SaveAs, and Print methods to preview the report, save it as a PDF file, and print it.\nThis example requires that you create a table for holding parameters that are entered on the report request page and a codeunit that runs the report methods.\nCreate a table called ReportParameters that has the following fields.\n```al\nvar\n    ReportId: Integer;\n    UserId: Code[100];\n    Parameters: BLOB;\n```\nCreate a codeunit and add the following code to the OnRun trigger of the codeunit.\n```al\nvar\n    ReportParameters: Record ReportParameters;\n    XmlParameters: Text;\n    OStream: OutStream;\n    IStream: InStream;\n    CurrentUser: Code[100];\n    Content: File;\n    TempFileName: Text;\nbegin\n    // Use the Report.RunRequestPage method to run the request page to get report parameters\n    XmlParameters := Report.RunRequestPage(206);\n    CurrentUser := UserId;\n\n    // Save the request page parameters to the database table\n    with ReportParameters do begin\n        // Cleanup\n        if Get(206,CurrentUser) then\n        Delete;\n\n        SetAutoCalcFields(Parameters);\n        ReportId := 206;\n        UserId := CurrentUser;\n        Parameters.CreateOutStream(OStream,TextEncoding::UTF8);\n        Message(XmlParameters);\n        OStream.WriteText(XmlParameters);\n\n        Insert;\n    end;\n\n    Clear(ReportParameters);\n    XmlParameters := '';\n\n    // Read the request page parameters from the database table\n    with ReportParameters do begin\n        SetAutoCalcFields(Parameters);\n        Get(206,CurrentUser);\n        Parameters.CreateInStream(IStream,TextEncoding::UTF8);\n        IStream.ReadText(XmlParameters);\n    end;\n\n    // Use the Report.SaveAs method to save the report as a PDF file\n    Content.Create('TestFile.pdf');  // only supported in Business Central on-premises\n    Content.CreateOutStream(OStream);  // only supported in Business Central on-premises\n    Report.SaveAs(206,XmlParameters,ReportFormat::Pdf,OStream);\n    Content.Close;  // only supported in Business Central on-premises\n\n    // Use the Report.Execute method to preview the report\n    Report.Execute(206,XmlParameters);\n\n    // Use the Report.Print method to print the report\n    Report.Print(206,XmlParameters);\nend;\n\n```\n## Related information\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}