Function SaveReportAs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

3/25/23, 4:30 PM Function: SaveReportAs

Function: SaveReportAs
Function Prototype

Note

Parameter Description

Return Value

Error Handling

Example

Result

This section describes the SaveReportAs function. This function enables you to save a created report file.

Function Prototype
SaveReportAs(pszFileName[, isRedirect])

Note
The save path does not support the network path format.

If a file with the same name exists in the specified directory, the file name extension .bak is added to
the file name, and then the system saves the created file.

Before the function is invoked, invoke Function: NewReport to create a report. The report buffer size
cannot exceed 128 MB.

Parameter Description

Parameter Description

pszFileName Path for saving the file. The value is a string. The UNIX file path (/) is supported. Files can only be
in .xls (Excel files), .html, or .htm (web page files) format.

NOTE:

If you set pszFileName to a relative path, the path where the created report file is saved
varies depending on the method for calling the SaveReportAs function.

When the SaveReportAs function in an .hsl3 script file is invoked, the report is saved in
the directory where the system output result directory resides, for example,
/export/home/ossshare/MAE/ScriptModuleService/var/script/RemoteTaskResults.
When the SaveReportAs function is invoked in the .hsp3 project package and the
package is executed in the script timer task, the report is generated in
/export/home/ossshare/MAE/ScriptModuleService/TimerTask/task
ID/output/result folder generated by the system.
https://10.98.117.5:31943/hedex/hedex.do?lib=OMC&id=omc.Scriptapp.mainpage&topicid=omc_iscript_reference_rpt_p_savereportas&locale=en-us 1/2
3/25/23, 4:30 PM Function: SaveReportAs

Parameter Description

When the SaveReportAs function is invoked in the .hsp3 project package and the
package is executed in the bookmark, the report is generated in the
/export/home/ossshare/MAE/ScriptModuleService/var/script/RemoteTaskResults
directory.

isRedirect Whether redirection is required. The value is of the Boolean type.


If it is set to True, the file path needs to be redirected to the task output directory. If it is set to
False, the file path does not need to be redirected.
The parameter value can be specified. If it is not specified, the default value False is used.

Return Value
The return value is an integer. If the report file is saved successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None

Example

NewReport()
page1 = AddSheet("page1")
SaveReportAs("exa08.xls")

Result

The exa08.xls file is created.

Examples of Report Operation Function

Copyright © Huawei Technologies Co., Ltd.

https://10.98.117.5:31943/hedex/hedex.do?lib=OMC&id=omc.Scriptapp.mainpage&topicid=omc_iscript_reference_rpt_p_savereportas&locale=en-us 2/2

You might also like