SELECT.PERFION.REPORTDATA

Selects content from a Perfion database using the special Super-Query syntax used to generate report content. This query only returns the pure data-content, without any layout, but includes all the data formatting as well as table generation based on the Perfion table-designer.
When selecting report-data, it will always be delivered as 3 separate Table data-sources named; Row, Features and Parameters.
Row: Contains the data of all the Items in the output. The columns are prefixed with i_ and c_ to distinguish data on Items in a catalog and data on the categorization structure.
Features: Contains all the metadata about the features used in the output (e.g. Captions, Units, Help-texts etc.)
Parameters: Contains values of the Report parameters used when generating the report. In the GUI, these can be adjusted by the User right before report-generation, however, when generating the data via an Action, these will already be known. If left undefined in the Action, the report will return the default values of any important parameter (e.g. Language).

Properties

From

Must contain (or reference) a connection string, in one of the following ways:

Name of a Data Source.
This data source must contain a connection string. This can be defined using the SET command.

Complete Connection-string:
Data Source=localhost;User ID=perfion;Password=mypw;Initial Catalog=perfiondb; PerfionUserID=admin;PerfionPassword=pswd;PerfionLanguage=EN;

Lookup from a named Connection defined in Perfion Go to Administration -> Remote Queries and open a query to see available Remote Connection names:
@REMOTECONNECTIONNAME=Perfion Production Database

Reference to current Perfion database:
Just type a '.' (period) in the From field

To

Unused.
Always delivers output to 3 Table data-sources (Row, Features and Parameters).
If any of them already exist, they will be overwritten.

Script

The Perfion Super-Query used for generating data for Reports.

Important: Make sure the Super-Query only contains a single feature in each of the From-clauses. The full and correct context for all data must be defined for the Action (e.g. no required user interaction to alter any values during generation).

The Super-Query can also be defined dynamically by including parameter references. The parameter values are evaluated in the same way as the script method { 9.16 Method: FillTemplate ( … ) }.
Example 1:
<Clause id='ExteriorColor' operator='=' value='{=$Color}' />
Example 2:
If you want to create the entire query dynamically, simply just include a reference to the parameter containing the query such as:
{=$MyQuery}

Properties

From

Name of the Input Data Source which contains the path to a file where Perfion super query is defined.

To

Name of the Output Data Source. Default TO.

Parameters

@ItemIDs

Specifies the ItemIDs to report on.

A Structured Report
The Super-Query contains 2 API-queries (one for the Categorization structure and one for the Items in the structure – e.g. Products in a Catalog).
In this case, the ItemIDs must be ID's of categories you want to include in the Report. In most cases it would just be a single ID of the Root item in the Catalog-structure.

An Individual Item Report
The Super-Query contains 1 API-query (e.g. individually selected Products to include in a Report, e.g. for generation of Product Data-Sheets).
In this case, the ItemIDs must be the ID's of the individual items (e.g. Products) you want to include in the Report.

The ItemIDs can be specified by this parameter in the following ways:
List
Directly specify a comma-separated list of IDs e.g. '106,131'
Variable reference
Get a comma-separated list of IDs from a variable by writing '{=$MyIDs}'
DataSource
Extract the IDs from a Table data-source that must contain a column named ItemID. A list of IDs is extracted from all the Rows in the data-source. Each row may only contain a single ItemID.

Map

This Command does not use any value mappings.

Example

Below example shows how data is retrieved for a structured catalog output from the Section with ItemID = 153. This would include all Products within this section, as well as all sub-sections within this hierarchy and all Products contained in all sections of this hierarchy.