{"title":"Report.Execute(Integer, Text [, RecordRef]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/report-execute-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/report-execute-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/report-execute-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 a report in preview or processing-only mode without showing the request page in the client.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Report.Execute(Integer, Text [, RecordRef]) Method","slug":"reportexecuteinteger-text-recordref-method","at":0,"chars":2616},{"level":2,"title":"Syntax","slug":"syntax","at":618,"chars":96},{"level":2,"title":"Parameters","slug":"parameters","at":714,"chars":493},{"level":2,"title":"Remarks","slug":"remarks","at":1207,"chars":705},{"level":2,"title":"Example (using `Report::<object identifier>` syntax)","slug":"example-using-reportobject-identifier-syntax","at":1912,"chars":570},{"level":2,"title":"Related information","slug":"related-information","at":2482,"chars":134}],"text":"# Report.Execute(Integer, Text [, RecordRef]) Method\n> Version: _Available or changed with runtime version 1.0._\nRuns a report in preview or processing-only mode without showing the request page in the client. The preview document will be downloaded as a PDF file to the user's browser client, where it can be read with the PDF reader. It won't open the Business Central preview page in the browser. The method gets the request page parameter values as an input parameter string from a RunRequestPage method call. The OnOpen and OnClose triggers on the request page will run even though the request page is not shown.\n## Syntax\n```al\n Report.Execute(Number: Integer, Parameters: Text [, RecordRef: RecordRef])\n```\n## Parameters\nNumber\nType: ../integer/integer-data-type\nThe ID of the report that you want to run. If the report that you specify does not exist, then a run-time error occurs.\nParameters\nType: ../text/text-data-type\nA string of request page parameters as XML to use to run the report. The parameter string is typically retrieved from the return value a RunRequestPage method call.\n*[Optional] RecordRef*\nType: ../recordref/recordref-data-type\nThe RecordRef that refers to a record in a table.\n## Remarks\nYou typically use this method together with the report-runrequestpage-method method. The report-runrequestpage-method) runs a report request page without actually running the report, but instead, it returns the parameters that are set on the request page as a string. You can then call the Execute method to get the parameter string and run the report.\nSee report-runrequestpage-method.\n> NOTE\n> Be careful when crafting the string for the RunRequestPage parameter without using the RunRequestPage method. If the XML content is malformed, then a runtime error might occur when calling Report.Execute.\n> NOTE\n> The Report.Execute method isn't supported for reports running with an Excel Layout.\n## Example (using `Report::<object identifier>` syntax)\nAs mentioned above, the Report.Execute method will throw a runtime error if no report with the supplied object ID exists. If you know the report object, a safe way to call Report.Execute is to use the `Report::<object identifier>` syntax as the compiler will tell you if the report object doesn't exist.\n```al\nprocedure MyProcKnownReport()\nvar\n    RequestPagePayload: Text;\nbegin\n    RequestPagePayload := Report.RunRequestPage(Report::MyReport);\n    Report.Execute(Report::MyReport, RequestPagePayload);\nend;\n```\n## Related information\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}