SAVEASEXCEL Function (Report)

Saves a report as a Microsoft Office Excel file.


[Ok :=] Report.SAVEASEXCEL(Number, FileName[, Record])
[Ok :=] Report.SAVEASEXCEL(FileName)

Parameters

Number

Type: Integer

The ID of the report that you want to run. You can click View, and then click C/AL Symbol Menu to select the report from a list.

If the report you specify does not exist, a run-time error occurs.

FileName

Type: Text

The path to and the name of the file that you want to save the report as.

Record

Type: Record

Specifies which record to use in the report. Any filters that have been applied to the record that you specify will be used.

Type: Boolean

If you omit this optional return value, then run-time errors can occur. If you include a return value, then it is assumed that you will handle any errors.

true if the report was saved; otherwise, false.

The SAVEASEXCEL function can be used on the Report type and on Report variables. This function is supported only on client report definition (RDLC) layouts. If you delete the RDLC layout and then run the SAVEASEXCEL function, then you get the following error:

The layout of this report has not been transformed to be viewed in the RoleTailored client. You can run this report from the Microsoft Dynamics NAV Classic client.

When you call the SAVEASEXCEL function, the report is generated and saved to "FileName." A Saving to Excel window shows the progress of the process. Note that the Request Form will not be shown.

Community Additions

ADD
Show: