RUN Function (Report)
Loads and executes the report that you specify.
After you define this variable, you can run this function or the Report.RUNMODAL function on the variable. The variable is automatically cleared after it executes this function.
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.
This example requires that you create the following variables.
|SomeReport||Report||Salesperson - Sales Statistics|
CustomerRec.SETCURRENTKEY("No."); CustomerRec.SETFILTER("Salesperson Code", 'JR|PS'); SomeReport.SETTABLEVIEW(CustomerRec); SomeReport.RUN