ReportsCollection

A collection of report templates.

Example

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

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

        -- Add three Word 2007 report templates to the POSTFEKO session

    templateName = FEKO_HOME..[[/shared/Resources/Automation/StartupModel.dotx]]    
    app.Reports:Add(templateName, pf.Enums.ReportDocumentTypeEnum.MSWord)
    app.Reports:Add(templateName, pf.Enums.ReportDocumentTypeEnum.MSWord)    
    app.Reports:Add(templateName, pf.Enums.ReportDocumentTypeEnum.MSWord)    

        -- Now obtain a list of the report templates

    reportList = app.Reports
    print("Available report templates that can be generated:")
    printlist(reportList)

end

Usage locations

The ReportsCollection object can be accessed from the following locations:

Property List

Count
The number of ReportTemplate items in the collection. (Read only number)
Type
The object type string. (Read only string)

Method List

Add (filename string, type ReportDocumentTypeEnum)
Adds a new report template to the collection. (Returns a ReportTemplate object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
ImportReportTemplate (filename string)
Import a report template from a (*.xml) file.
Item (index number)
Returns the ReportTemplate at the given index. (Returns a ReportTemplate object.)
Item (label string)
Returns the ReportTemplate with the given label. (Returns a ReportTemplate object.)
Items ()
Returns a table of ReportTemplate. (Returns a List of ReportTemplate object.)
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated. (Returns a boolean object.)

Index List

[number]
Returns the ReportTemplate at the given index in the collection. (Read ReportTemplate)
[string]
Returns the ReportTemplate with the given name in the collection. (Read ReportTemplate)

Property Details

Count
The number of ReportTemplate items in the collection.
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only

Method Details

Add (filename string, type ReportDocumentTypeEnum)
Adds a new report template to the collection.
Input Parameters
filename(string)
The name of the template document to generate the report from.
type(ReportDocumentTypeEnum)
The document type specified by the ReportDocumentTypeEnum, e.g. PDF, MSWord or MSPowerPoint.
Return
ReportTemplate
The report template to generate.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the ReportTemplate.
Return
boolean
The success of the check.
ImportReportTemplate (filename string)
Import a report template from a (*.xml) file.
Input Parameters
filename(string)
The name of the report template configuration file (*.xml) to be imported.
Item (index number)
Returns the ReportTemplate at the given index.
Input Parameters
index(number)
The index of the ReportTemplate.
Return
ReportTemplate
The ReportTemplate at the given index.
Item (label string)
Returns the ReportTemplate with the given label.
Input Parameters
label(string)
The label of the ReportTemplate.
Return
ReportTemplate
The ReportTemplate with the given label.
Items ()
Returns a table of ReportTemplate.
Return
List of ReportTemplate
A table of ReportTemplate.
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated.
Input Parameters
label(string)
The base name.
Return
boolean
The generated unique name label for ReportTemplate.