Report.Run(Integer [, Boolean] [, Boolean] [, var Record]) Method
Version: Available or changed with runtime version 1.0.
Loads and executes the report that you specify.
Report.Run(Number: Integer [, RequestWindow: Boolean] [, SystemPrinter: Boolean] [, var Record: Record])
The ID of the report that you want to run.
Specifies whether the request window for the report will be displayed. The request window is part of the report object.
Specifies whether to use the default Windows printer or use table 78, Printer Selection, to find the correct printer for this report.
Specifies which record to use in the report. Any filters that are attached to the record that you specify are used.
Use this method, or the Report.RunModal Method, if you do not know the specific report that you want to run when you are designing your application. If you do know the specific report that you want to run, then you can use the Run Method or the RunModal Method.
If the report you specify does not exist, then a compile error occurs.
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. 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.
This example shows how to run a report. This example displays the request window and sends the report to the printer that is selected in the Printer Selection table.
This 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 is selected in the Printer Selection table.
This 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.
Report.Run(1001, False, True);
This 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.
var MyRec: Record Customer; begin MyRec.FindLast; MyRec.SetRecFilter; Report.Run(101, True, True, MyRec); end;