Skip to main content

From XML File

The From XML File function is used to import data from a specific Table in an XML file.

Settings

Directory

The directory where the XML file to import from exists. If this is left blank, the Reports Directory of the current project is used (as defined in the Project Explorer). If this is not a full path reference, the setting is used as subfolders of the Reports Directory.

This can be a fixed name or cell reference where the cell reference contains the directory. Fixed names can contain XLReporter Name Types like {YYYY}, {MMM}, etc. See the Name Types chapter for the full list of supported keywords.

XML File

The name of the XML file to import.

This can be a fixed name or cell reference where the cell reference contains the directory. Fixed names can contain XLReporter Name Types like {YYYY}, {MMM}, etc.

If this setting contains a full path, that path is used as the Directory.

In addition, the XML File can be specified with a wildcard. This changes the setting from a specific file name to a filter that is used to get the most recent file in the Directory specified. For example, an XML File of Flow*.xml would import data from the most recent file in the Directory that starts with Flow and ends with .xml.

Table

This setting is the name of the table in the XML file to import data from. If there are multiple tables in the file to import data from, each must be specified in their own Management connection.

Heading

This setting determines how the column headings in the Table are handled.

  • None

    This indicates that only data is imported into the report from the file. Every column is imported in the order it is shown in the file.

  • From File

    This indicates that the column headings of the table in the file are shown as the top row with the data in subsequent rows beneath. Every column is imported in the order it is shown in the file.

  • From Sheet

    This indicates that the headings are from the worksheet, one row above the Placement Cell specified. The headings from the sheet determine which headings are imported from the table in the file as well as the order in which they are displayed in the report. With the setting, the headings from the sheet must match exactly with the column names in the table in the file.

    For example, if the table in the file consists of the columns Flow, Speed, Pressure, Temp and Timestamp but you only want to show Timestamp and Speed data starting in $B$4, in $B$3 enter Timestamp and in $C$3 enter Speed.

Example

A third-party software vendor produces an XML file every day containing data that needs to be brought into a daily report alongside process data that XLReporter can access directly.

To bring in the data from the XML file a From XML File function is configured. The settings are:

Placement

Cell

$B$4

Type

Direct

Setting

Value

Directory

C:\MyXMLFiles

XML File

{YY}-{MM}-{DD}.xml

Table

Data

Headings

None