Muokkaa

Jaa


Report.Execute(Text [, RecordRef]) Method

Version: Available or changed with runtime version 1.0.

Runs a report in preview or processing-only mode without showing the request page in the client. The preview document will be downloaded as a PDF file to the user's browser client, where it can be read with the PDF reader. It won't open the Business Central preview page in the browser. The method gets the request page parameter values as an input parameter string from a RunRequestPage method call. The OnOpen and OnClose triggers on the request page will run even though the request page is not shown.

Syntax

 Report.Execute(Parameters: Text [, RecordRef: RecordRef])

Parameters

Report
 Type: Report
An instance of the Report data type.

Parameters
 Type: Text
A string of request page parameters as XML to use to run the report. The parameter string is typically retrieved from the return value a RunRequestPage method call.

[Optional] RecordRef
 Type: RecordRef
The RecordRef that refers to a record in a table.

Remarks

After the Execute method is executed, the system does not automatically clear the Report variable. You must handle clearing the variable.

You typically use this method together with the RunRequestPage Method. The RunRequestPage method runs a report request page without actually running the report, but instead, returns the parameters that are set on the request page as a string. You can then call the Execute method to get the parameter string and run the report.

For a simple example that illustrates how to use the Execute method, see example in the RunRequestPage Method topic.

Report Data Type
Get Started with AL
Developing Extensions