Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

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.

Syntax

[Result=] aaHistClientWorkbookRunner.RunReport(

message inputFile,

message outputFile,

message outputPrefix,

integer outputFormat,

message tagString,

integer NSFolderKey,

message nameSpace,

integer dateMode,

message startDate,

message endDate,

integer duration);

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 that is 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 that is 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. 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. 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.

Return Value

Returns the output file name if the report generation was successful; otherwise, an empty string is returned.

Remarks

When this method is called, the following occurs:

  1. Excel starts. Excel is visible only if the ExcelVisible property was set to True.

  2. The Workbook file (.xlsx) specified by the SourceFile property opens.

  3. The binding information in the workbook file is updated.

  4. The report runs and the output is saved as an .htm file as specified in the OutputFile property.

  5. Excel closes.

To run a report without using the binding options, use the method. To run a report that only uses additional binding options for custom filters, use the RunReport2 method.

In This Topic
TitleResults for “How to create a CRG?”Also Available in