{"title":"Report.Execute(Text [, RecordRef]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/reportinstance-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/reportinstance-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/reportinstance-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(Text [, RecordRef]) Method","slug":"reportexecutetext-recordref-method","at":0,"chars":1838},{"level":2,"title":"Syntax","slug":"syntax","at":609,"chars":79},{"level":2,"title":"Parameters","slug":"parameters","at":688,"chars":408},{"level":2,"title":"Remarks","slug":"remarks","at":1096,"chars":608},{"level":2,"title":"Related information","slug":"related-information","at":1704,"chars":134}],"text":"# Report.Execute(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(Parameters: Text [, RecordRef: RecordRef])\n```\n## Parameters\nReport\nType: report-data-type\nAn instance of the report-data-type data type.\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\nAfter the Execute method is executed, the system does not automatically clear the Report variable. You must handle clearing the variable.\nYou typically use this method together with the report-runrequestpage-method. The RunRequestPage method runs a report request page without actually running the report, but instead, 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.\nFor a simple example that illustrates how to use the Execute method, see example in the report-runrequestpage-method topic.\n## Related information\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}