{"title":"Report.RunModal() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/reportinstance-runmodal-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-runmodal-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-runmodal-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":2,"title":"Syntax","slug":"syntax","at":108,"chars":39},{"level":2,"title":"Parameters","slug":"parameters","at":147,"chars":91},{"level":2,"title":"Remarks","slug":"remarks","at":238,"chars":1261},{"level":2,"title":"Example","slug":"example","at":1499,"chars":247},{"level":2,"title":"Related information","slug":"related-information","at":1746,"chars":190}],"text":"> Version: _Available or changed with runtime version 1.0._\nLoads and executes the report that you specify.\n## Syntax\n```al\n Report.RunModal()\n```\n## Parameters\nReport\nType: report-data-type\nAn instance of the report-data-type data type.\n## Remarks\nAfter you define the Report variable, you can run this method or the reportinstance-run-method on the variable. As opposed to the Run method, with the RunModal method, the variable is not cleared after it executes this function. You must handle clearing the variable.\nUse the RunModal method or the Run method if you know at design time the exact report you want to run. Otherwise, use the report-runmodal-method or report-run-method.\nThe request page is run modally when you use this method.\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## Example\n```al\nvar\n    CustomerRec: Record Customer;\n    SalesReport: Report \"Chart of Accounts\";\nbegin\n    …\n    Clear(CustomerRec);\n    CustomerRec.SetRecFilter;\n\n    SalesReport.SetTableView(CustomerRec);\n    SalesReport.RunModal();\nend;\n```\n## Related information\nReport.RunModal (static) Method<report-runmodal-method>\nreport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}