SAVEASHTML Function (Report)
Saves a report as an HTML file. We recommend that you use a browser that supports at least HTML version 3.0 for viewing the file.
[Ok :=] Report.SAVEASHTML(Number, FileName [,SystemPrinter] [, Rec]) [Ok :=] Report.SAVEASHTML(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.
- 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.
The SaveAsHTML function can be used on the Report type and on Report variables.
When SaveAsHTML is called, the report is generated and saved to "FileName." The Saving to HTML window is displayed and shows the status of the process. You can manually cancel the generation of the report and cancel saving the report as an HTML 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 an 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 HTML box," and so on. The object is 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 SAVEASHTML function. From the Classic client, the SAVEASHTML function is supported.