You use queries to evaluate certain data elements for your report. A query searches a selected dataset and returns the data elements found for output in the report. You can use various filters to further restrict the number of data elements output. In report scripts, you can insert a query into an existing query, directly into a section, or into a data table.
A static area is available for queries for which certain values of the data elements found should only be output once, for example, for output of an individual item, a list, or a chart.
The repetition area is available for a query for which certain values should be output for each individual item of the result set, for example, for the names of all EPCs in the selected groups.
In data tables, the individual values of queried data elements are listed in table format. For each data element found, a line is inserted, in which the relevant values can be output.
Data fields or charts are used to output the relevant values (for example, function names) of the data elements found.
Queries can be nested by inserting up to a maximum of five subordinate queries. On a hierarchy level, you can create as many queries as you like.
Example
You want to search certain groups (selected groups) of a database for existing models of the EPC type and output the names of the models found, of the groups, and of the current database.
Procedure
When you create a report, select Selected groups as the context, which means that the report can be run for selected groups.
To be able to evaluate all relevant EPCs, first insert a subordinate query that searches all models in the selected groups, and then set a filter for models of the EPC model type to restrict the query.
To output the relevant names, insert the corresponding data fields.
A data field in the static area of the top section Selected groups outputs the name of the current database once.
A data field in the repetition area For all: Selected groups of the top section outputs the names of all selected groups.
A data field in the repetition area For all: Selected groups.Model list (filterable by type) of the subordinate query outputs all names of the EPC type models.
A report script template defined in this way could look like this:
The corresponding output in the report could look like this:
Database name: My database
Group name: Group1
Model name: EPC1 (Group1)
Model name: EPC2 (Group1)
...
Group name: Group2
Model name: EPC1 (Group2)
Model name: EPC2 (Group2)
...