RunReport
- Last UpdatedNov 17, 2021
- 4 minute read
The RunReport method processes the Workbook report. This method uses the date/time binding feature of Workbook, plus custom binding filters. need x-refs
Syntax
[Result=] ActiveFactoryWorkbook.RunReport(
message inputFile,
message outputFile,
message outputPrefix,
integer outputFormat,
message tagString,
integer NSFolderKey,
message nameSpace,
integer dateMode,
message startDate,
message endDate,
integer duration
message customFilters);
Parameters
inputFile
The name of the source file for the report generation, including the full path. Valid file types are .htm, .xlsx, and .xlt.
outputFile
The name of the output file generated, including the full path. If this parameter is set to an empty string ( "" ), then a file name is generated automatically according to the following formula:
OutputFile = OutputPrefix + InputFile + _ + year + month + day + hour + minute + second
outputPrefix
The value prepended to the output file name. If you specify an empty string ( "" ), no prefix is prepended.
The outputPrefix parameter is only used if the outputFile parameter is an empty string.
outputFormat
The file type for the output file. Valid values are:
0 = Native. That is, if the source file is an .htm file, the output file is an .htm file. If the source file is an .xlsx or .xlt file, the output file is an .xlsx file.
1 = .htm
2 = .xlsx
3 = .xlt
tagString
A comma separated list of strings to be used for the AFTagBinding named range. If the AFTagBinding range does not exist, and this parameter is set to any value other than an empty string ( "" ), an error is raised. Valid formats are:
"<tagname1>,<tagname2>"
"'<tagname1>','<tagname2>'"
For example:
"ReactLevel,ReactTemp"
"'ReactLevel','ReactTemp'"
NSFolderKey
Reserved for future use. This parameter cannot be blank. Specify a value (for example, 0) for this parameter, even though it has no effect.
nameSpace
Reserved for future use. This parameter cannot be blank. Specify an empty string ( "" ) for this parameter, even though it has no effect.
dateMode
Determines the values used for the AFStartBinding and AFEndBinding named ranges. An error is raised if the binding ranges do not exist or if this parameter is blank. Valid values are:
0 = Use specific start and end times.
1 = Use a duration relative to the current time.
2 = Use a duration relative to the specified start time.
3 = Use a duration relative to the specified end time.
Use the startDate, endDate, and Duration parameters to specify the dates.
startDate
A date string that can be converted to a date by the Visual Basic CDate() function. A good format to use is one that reflects the standard short date and short time format on the local system.
If the dateMode parameter is set to 1 or 3, this parameter is ignored.
If the dateMode parameter is set to 0, this value indicates the specific date/time to be used for the AFStartBinding range.
If the dateMode parameter is set to 2, then "rel" is used for the AFStartBinding range and '+Duration(StartDate)' is used for the AFEndBinding range.
endDate
A date string that can be converted to a date by the Visual Basic CDate() function. A good format to use is one that reflects the standard short date and short time format on the local system.
If the dateMode parameter is set to 1 or 2, this parameter is ignored.
If the dateMode parameter is set to 0, this value indicates the specific date/time to be used for the AFEndBinding range.
If the dateMode parameter is set to 3, then "rel" is used for the AFStartBinding range and '+Duration(EndDate)' is used for the AFEndBinding range.
Duration
The time span, in seconds, used for date/time calculations. This value cannot be a negative number.
If the dateMode parameter is set to 0, this value is ignored.
If the dateMode parameter is set to 1, "rel" is used for the AFStartBinding range and '-Duration()' is used for the AFEndBinding range.
If the dateMode parameter is set to 2, "rel" is used for the AFStartBinding range and '+Duration(StartDate)' is used for the AFEndBinding range.
If the dateMode parameter is set to 3, "rel" is used for the AFStartBinding range and '-Duration(EndDate)' is used for the AFEndBinding range.
customFilters
A string of name-value pairs used to pass information from the AVEVA Information Server to the workbook file before the report is run.
The format for the string is as follows:
<name>=<value>
To pass more than one name-value pair, join them with ampersands. For example:
<name>=<value>&<name>=<value>
The parameter name that you use must correspond to an existing named range in the workbook that starts with "AFBinding."
The value you specify in the name-value pair is used for the corresponding named range in the workbook. You can specify multiple values if you separate them with commas.
For example, your workbook contains the AFBindingReportValue and AFBindingReportText named ranges. You want to pass a value of 5 for the report value and Line1 and Line2 for the ReportText. The customFilters parameter is:
ReportValue=5&ReportText=Line2,Line2
Return Value
Returns the output file name if the report generation was successful; otherwise, an empty string is returned.