ReportTemplate

A report template document to generate.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.pfs]])

    -- Only generate the report if Microsoft Word is installed
    
if ( app.MSWordInstalled ) then

        -- Add a Word 2007 report template to the POSTFEKO session
    
    reportTemplate = app.Reports:Add(
        FEKO_HOME..[[/shared/Resources/Automation/StartupModel.dotx]], 
        pf.Enums.ReportDocumentTypeEnum.MSWord)    

        -- Extract the tags from the template document and get a list of the open windows in the 
        -- current session

    tags = reportTemplate.Tags
    windows = reportTemplate.Windows
    
        -- Build a map of tags to window titles
    
    tagwindownames = {}
    tagwindownames["Graph1:"] = "startup1"
    tagwindownames[tags[2]] = windows[3]
    reportTemplate.TagSettings:Modify(tagwindownames)

        -- Generate the report
        
    reportTemplate:Generate([[temp_StartupModelReport.docx]])
end

Inheritance

The ReportTemplate object is derived from the ResultReport object.

Property List

DocumentType
The report template document type. (Read/Write ReportDocumentTypeEnum)
ImageFormat
The image format to use when exporting images for the template report. (Read/Write string)
ImageSize
Report image export size options. (Read only ReportImageSizeSetting)
Label
The object label. (Read/Write string)
Tags
The tags extracted from the template file. (Read only List of string)
TemplateFilename
The template document used to generate the report. (Read/Write string)
Type
The object type string. (Read only string)
Windows
Gives the list of windows that can be exported to the report. (Read only List of string)

Collection List

TagSettings
The report template tag and window settings. (ReportTemplateTagCollection of ReportTemplateTagSettings.)

Method List

Delete ()
Delete the report template.
Duplicate ()
Duplicate the report template. (Returns a ReportTemplate object.)
ExportReportTemplate (filename string)
Export a report template to a (*.xml) file.
Generate (filename string)
Generates the report template.
GenerateAndOpen (filename string)
Generates and opens the report template.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table object.)
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.

Property Details

DocumentType
The report template document type.
Type
ReportDocumentTypeEnum
Access
Read/Write
ImageFormat
The image format to use when exporting images for the template report.
Type
string
Access
Read/Write
ImageSize
Report image export size options.
Type
ReportImageSizeSetting
Access
Read only
Label
The object label.
Type
string
Access
Read/Write
Tags
The tags extracted from the template file.
Access
Read only
TemplateFilename
The template document used to generate the report.
Type
string
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only
Windows
Gives the list of windows that can be exported to the report.
Access
Read only

Collection Details

TagSettings
The report template tag and window settings.
Type
ReportTemplateTagCollection

Method Details

Delete ()
Delete the report template.
Duplicate ()
Duplicate the report template.
Return
ReportTemplate
The duplicated report template.
ExportReportTemplate (filename string)
Export a report template to a (*.xml) file.
Input Parameters
filename(string)
The filename of the report template file (*.xml) to be exported.
Generate (filename string)
Generates the report template.
Input Parameters
filename(string)
The filename of the report document without its extension.
GenerateAndOpen (filename string)
Generates and opens the report template.
Input Parameters
filename(string)
The filename of the report document without its extension.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A properties table.
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(table)
A table of properties defining the new state of the object.