SAVEASXML Function (Report)

Microsoft Dynamics Nav 2009

Saves a report as an .xml file.


[Ok :=] Report.SAVEASXML(Number, FileName [,SystemPrinter][,Rec])
[Ok :=] Report.SAVEASXML(FileName)

Parameters

Number

Type: Integer

The ID of the report that you want to run. On the View menu, click C/AL Symbol Menu to select the report from a list.

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

FileName

Type: Text

The path and 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 a run-time error occurs if the record cannot be found. 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 SaveAsXML function can be used on the Report type and on Report variables.

When SaveAsXML is called, the report is generated and saved to "FileName." A Saving to XML window is displayed and shows the status of the process. If you click Cancel, then the report is not generated or saved as an .xml file. The Request Form is not shown.

The return value indicates whether the report has been saved successfully. If you use this value and an error occurs, then false is returned. If you do not use the return value, then the error results in an error message such as "Out of hard disk space," "The file parameter is not open," "The user cancelled from the Save As XML box," and so on. The object is then closed.

This function is not supported on the computer running Microsoft Dynamics NAV Server. Therefore, if you run either a Classic report layout or a client report definition (RDLC) report layout from the RoleTailored client, then you cannot call the SAVEASXML function. From the Classic client, the SAVEASXML function is supported.

Community Additions

ADD
Show: