Loads and runs the report that you specify. The report is run modally.
REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])
- Type: Integer The ID of the report that you want to run. To select the report from a list, on the View menu, choose Symbols. If the report that you specify does not exist, then a run-time error occurs.
Specifies whether the request window for the report will be displayed. The request window is part of the report object.
Specify true, which is the default value, to display the request window before you run the report. Specify false to run the report without displaying the request window.
This parameter overrides the setting of the UseRequestPage Property of the report. If you do not provide a value for the ReqWindow parameter, then the setting of the UseRequestPage property is used.
Important Client-side printing is not supported by Microsoft Dynamics NAV Web client. If you set this parameter to false and the report will be run on Microsoft Dynamics NAV Web client, you must set up the report to print from Microsoft Dynamics NAV Server, otherwise an error occurs at runtime. For more information, see How to: Specify Printer Selection for Reports and STARTSESSION Function (Sessions).
- Type: Boolean Specifies whether to use the default Windows printer or use table 78, Printer Selection, to find the correct printer for this report. For example, if the report prints on continuous forms, then you can set up an entry in the Printer Selection table to specify to always print this report on a specific printer. Specify true to use the printer defined as the system printer. Specify false, which is the default value, to use the printer that is defined in the Printer Selection table.
- Type: Record Specifies which record to use in the report. Any filters that are attached to the record that you specify are used.
If you do not know the specific report that you want to run when you are designing your application, then use this function or the REPORT.RUN Function. If you do know the specific report that you want to run, then you can use the RUN Function (Report) or the RUNMODAL Function (Report). When you use these functions the request page runs modally. However, when you choose Preview on the request page, the Print Preview page does not run modally.
The request page is run modally when you use this function.
This example shows how to run a report. This example displays the request window and sends the report to the printer selected through 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.RUNMODAL(1001, FALSE, TRUE);