{"title":"Report.Run(Integer [, Boolean] [, Boolean] [, var Record]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/report-run-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-run-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-run-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":"Loads and executes the report that you specify.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Report.Run(Integer [, Boolean] [, Boolean] [, var Record]) Method","slug":"reportruninteger-boolean-boolean-var-record-method","at":0,"chars":4001},{"level":2,"title":"Syntax","slug":"syntax","at":176,"chars":126},{"level":2,"title":"Parameters","slug":"parameters","at":302,"chars":646},{"level":2,"title":"Remarks","slug":"remarks","at":948,"chars":1128},{"level":2,"title":"Printing","slug":"printing","at":2076,"chars":346},{"level":2,"title":"Example: Using `Report::<object ID>` syntax","slug":"example-using-reportobject-id-syntax","at":2422,"chars":404},{"level":2,"title":"Example 1","slug":"example-1","at":2826,"chars":208},{"level":2,"title":"Example 2","slug":"example-2","at":3034,"chars":244},{"level":2,"title":"Example 3","slug":"example-3","at":3278,"chars":283},{"level":2,"title":"Example 4","slug":"example-4","at":3561,"chars":306},{"level":2,"title":"Related information","slug":"related-information","at":3867,"chars":134}],"text":"# Report.Run(Integer [, Boolean] [, Boolean] [, var Record]) Method\n> Version: _Available or changed with runtime version 1.0._\nLoads and executes the report that you specify.\n## Syntax\n```al\n Report.Run(Number: Integer [, RequestWindow: Boolean] [, SystemPrinter: Boolean] [, var Record: Record])\n```\n## Parameters\nNumber\nType: ../integer/integer-data-type\nThe ID of the report that you want to run.\n*[Optional] RequestWindow*\nType: ../boolean/boolean-data-type\nSpecifies whether the request window for the report will be displayed. The request window is part of the report object.\n*[Optional] SystemPrinter*\nType: ../boolean/boolean-data-type\nSpecifies whether to use the default Windows printer or use table 78, Printer Selection, to find the correct printer for this report.\n*[Optional] Record*\nType: ../record/record-data-type\nSpecifies which record to use in the report. Any filters that are attached to the record that you specify are used.\n## Remarks\nUse this method, or the report-runmodal-method, if you don't know the specific report that you want to run when you're designing your application. If you do know the specific report that you want to run, then you can use the reportinstance-run-method or the reportinstance-runmodal-method.\nIf the report you specify doesn't exist, then a runtime error occurs.\n> NOTE\n> Internet browsers can only handle one file per request. Therefore, with the Web client, if this method is called in a repetitive statement (or loop) that generates multiple files, only the last file will be sent to the browser. Alternatively, when designing for the Web client, bundle the files in an archive file (.zip), for example, by using the methods found in codeunit 419 File Management. For more details about this design pattern, see Multi-File Download<https://alguidelines.dev/docs/navpatterns/patterns/multi-file-download/>. The methods in codeunit 419 aren't external, therefore can't be used in extensions. Instead, when developing extensions in AL, use the external methods of codeunit 425 Data Compression. The approach is similar.\n## Printing\nThe parameter SystemPrinter is only used for on-premises scenarios (print on server). Here, the Business Central server will use the default printer on the server if you use `SystemPrinter = true`, otherwise it uses the printer selection.\nFor the online version of Business Central, users can use printer extension and browser print.\n## Example: Using `Report::<object ID>` syntax\nAs mentioned previously, the Report.Run method throws a runtime error if no report with the supplied object ID exists. If you know the report object, a safe way to call Report.Run is to use the `Report::<object identifier>` syntax because the compiler will tell you if the report object doesn't exist.\n```al\nbegin\n    Report.Run(Report::MyReport);\nend;\n```\n## Example 1\nThis example shows how to run a report. This example displays the request window and sends the report to the printer that's selected in the `Printer Selection` table.\n```al\nReport.Run(1001);\n```\n## Example 2\nThis example shows how to run a report. This example skips the request window, starts the report immediately, and sends the report to the printer that's selected in the `Printer Selection` table.\n```al\nReport.Run(1001, False);\n```\n## Example 3\nThis example shows how to run a report. This example skips the request window and starts the report immediately. It sends the report to the system printer instead of the printer that is selected in the `Printer Selection` table.\n```al\nReport.Run(1001, False, True);\n```\n## Example 4\nThis example shows how to run a report for which you specify a record. This example displays the request window and sends the report to the system printer.\n```al\nvar\n    MyRec: Record Customer;\nbegin\n    MyRec.FindLast;\n    MyRec.SetRecFilter;\n    Report.Run(101, True, True, MyRec);\nend;\n```\n## Related information\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}