Report.Run() Method
Version: Available or changed with runtime version 1.0.
Loads and executes the report that you specify.
Syntax
Report.Run()
Parameters
Report
Type: Report
An instance of the Report data type.
Remarks
After you define the Report variable, you can run this method or the RunModal Method (Report) on the variable. With the Run
method, the variable is automatically cleared after the method is run. With the RunModal
method, the variable isn't automatically cleared.
Use the Run
method or the RunModal
method if you know at design time the exact report that you want to run. Otherwise, use the static methods Report.Run Method or Report.RunModal Method.
Note
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.
Example
var
CustomerRec: Record Customer;
SalesReport: Report "Salesperson - Sales Statistics";
begin
CustomerRec.SetCurrentKey("No.");
CustomerRec.SetFilter("Salesperson Code", 'JR|PS');
SalesReport.SetTableView(CustomerRec);
SalesReport.Run();
end;