Building Reports
Create a Report Builder report in Pimcore Studio like any other custom report, then describe it in the panels of the
builder. A report needs the permission reports_config to be created or changed.
Create a Report
- Open Custom Reports in Pimcore Studio and create a new report.
- Select Report Builder as the data source type.
- Build the report with the panels described below.
- Save the report. Share it with users and roles in the report settings like any other custom report.
The panel Report definition holds the editor. It starts with the panel Data, where you choose the data and what the report shows, followed by one collapsible panel per part of the report: Filters, Values and groups (or Columns for a list), Sort and limit (lists only), Visualize and On click. The panels are open by default, except an empty On click. A collapsed panel shows a one-line summary. A panel that needs attention is marked.
The Preview panel next to the editor (below the editor in a narrow window) runs the report with the permissions of the current user and shows at most 50 rows or 50 groups per grouping. It starts with the report as a sentence, for example Count of Car by Manufacturer, where Production year is at least 2020. Wide preview hides the editor panels to give the preview the full width.
A report that cannot run yet can be saved as a draft. The JSON view lists what is missing. Saving stores the configuration even when validation reports errors, because the generic custom report save does not validate it. The builder shows the errors live. Opening an invalid report answers with the error message "Invalid report:", followed by the validation errors with their paths in the configuration.
Saving fills the column configuration of the report with the generated columns when it is empty or outdated, so the CSV export has columns. Reports created through the MCP tools get the same on save. A report that is stored without columns (written by PHP, a config file or a deployment) gets them when it is loaded, in memory only, so its CSV export starts with the header row.
The switch Builder / JSON at the top of the panel changes to the saved JSON configuration. Changes in the JSON update the panels and the other way around. See Report Configuration Schema for the format.
Data
Choose what the report reads:
- Data objects: one data object class. Every indexed object of the class counts, variants included. Filter the
typefield to restrict them. - Assets: all assets.
- Documents: all documents.
- Events: a registered event index, for example portal logins or downloads.
Choosing other data starts a new report because field paths are specific to the data.
Language next to the data sets the language of localized fields in groups, filters, sorts and lists. The select
offers Viewer's language (the default, the configuration has no language) and the languages the editing user may
view, because the editor could not preview the others. Choosing a language writes language into the configuration;
Viewer's language removes it. Below the select the builder shows the language the server runs the report in. A report
with a language is the default for everyone who opens it: viewers may switch among the languages they may view, see
Viewing Reports. The language of the advanced filter is written in the query
(name.de) and does not follow the select. Literal filter values (name = "Item 12") are values of one language and
may match nothing after a switch.
Filters
Filters restrict the elements before they are listed or summarized. All filters must match.
- Select Add filter and pick a field.
- Set the operator and value. The filter uses the same components as the grid filters of Pimcore Studio.
- Open the filter and switch on Viewers can change this value to turn it into a parameter. See Parameters.
Operators depend on the type of the field:
- Short text: is, is not (also for several values), contains, does not contain, is empty, has a value.
- Long text: contains, does not contain, is empty, has a value.
- Number: is, is not (also for several values), less than, at most, more than, at least, between, is empty, has a value.
- Date: is, is not, less than, at most, more than, at least, between, in the last, is empty, has a value.
- Boolean: is, is not, is empty, has a value.
- Id or relation: is, is not (also for several values), is empty, has a value.
Dates can be fixed (between two dates) or relative (in the last 30 days). A relative period always ends now.
between on a date includes both whole days. between on a number includes its start and excludes its end (10 to 20 lists 10 up to, but not including, 20), also for quantity values; the parameter bar marks the end as excluded.
Advanced Filter (PQL)
Select Add an advanced filter (PQL) below the filters to open the field Advanced filter (PQL). It takes a
query in the Pimcore Query Language (PQL)
of the Generic Data Index, the language of the search field of the grids in Pimcore Studio. It is not a separate
language: the Report Builder reads the query with the lexer and the parser of the Generic Data Index and turns it into
a search with the same processor as the grid search. The syntax, the operators, the wildcards and the NULL and
EMPTY values are described in the documentation of the Generic Data Index; this page lists only what differs.
Use the filter for criteria the visual filters cannot express, such as OR and brackets. The query narrows the report further: elements must match the filters and the query. The field is not available for event datasets. Insert field appends the name of a field to the end of the query, Remove advanced filter deletes the query.
(name LIKE "*Alfa*" OR name LIKE "*Fiat*") AND productionYear >= 2020 AND published = "true"
Differences to the grid search:
- Only fields of the field list of the data can be used, with or without the category:
powerandstandard_fields.powerare the same field. Fields that are not in the list are rejected, including internal index fields and classification store keys. Use the visual filters for classification store keys. - A localized field needs a language (
name.en), and the language must be one the user may view, see Permissions and Limits. Insert field writes the language code the server runs the report in: the language of the report, else the language of the user when it is a valid content language, else the first language the user may view. Before the first validation has answered, the editor uses the language of the report, else the first valid language of the installation. Text metadata of assets stored without a language is the value of every language that has none of its own, in filters, groups, sorts and lists; this is not a language fallback chain. QUERY(...)is rejected for every user, see below.- A field of a related element is written with one relation step, see below. Deeper lookups are rejected.
- The limits of an advanced filter apply: length, tokens, bracket depth, comparisons and leading wildcards.
Notes:
- Booleans are strings: write
published = "true", notpublished = 1. - Numbers are written without quotes, strings in single or double quotes. Write a quote inside a string twice (
''or""). - The query runs with the permissions of the user like the rest of the report and can only narrow the result.
Comparisons on the ids of related elements, for example
manufacturer.object = 10orparentId != 3, compare only related elements the user may view, like the visual relation filter. Users who are not administrators can use=and!=with an id and= NULL,!= NULL,= EMPTY,!= EMPTYthere, see Advanced Filter Limits.
AND and OR are evaluated from left to right without precedence: a OR b AND c is (a OR b) AND c. Use brackets
to group. There is no NOT (...); negate with != or NOT LIKE.
The editor marks an error in the query at its position.
Conditions on fields of related elements
relation:Class.field compares a field of the related element, for example manufacturer:Manufacturer.name = "Ford"
or manufacturer:Manufacturer.name.en LIKE "F*" for a localized field. It is the form of the Generic Data Index, with
these rules:
- One relation step. The field must be a lookup field of the field list with exactly one relation (Manufacturer ›
Name), and
Classis the class the relation points to (AssetandDocumentfor relations to assets and documents). Deeper lookups (manufacturer.country.name), relations to several classes, a relation at the end, other classes and fields that are not in the field list are rejected at their position, for every user, administrators included. A field the block list removed is rejected like a field outside the field list. - The operators of the field itself (
=,!=,<,>,<=,>=,LIKE,NOT LIKE,EMPTY,NULL), with the wildcards ofLIKEas on the fields of the element.=,<,>,<=and>=return the same elements as the visual filter on the same lookup field. - At most 5 such conditions in an advanced filter, because each one runs searches of its own. Each counts as one comparison towards the limit of 50.
- The report resolves the condition itself, not the search index: it searches the related elements the viewer may view and compares the stored relation of the element with them. A related element the viewer may not view never makes an element match, for any operator.
- Negated conditions (
!=,NOT LIKE,EMPTY,NULL) match an element through a related element the viewer may view whose field satisfies them. They differ from the visual filters here: an element without such a related element (no relation, or only related elements the viewer may not view) does not match them, where the visual filters also match an element with no related element at all. - Above the number of related elements a filter can hold, the condition behaves like the visual filter on the same lookup field, fallback included: for users who are not administrators it looks among the related elements the report refers to, narrowed by the visual filters of the report only (other parts of the query can sit inside an OR); otherwise it fails with the same error.
Comparisons on the ids of related elements, for example manufacturer.object, are described above and are a
different thing: they compare the ids the element stores, with the related elements the user may view.
Why QUERY() is rejected
QUERY("...") hands a raw search query string to the search index. The Report Builder cannot check such a string
against the field list, the language permission of the user or the cost limits: it reaches every field of the index,
including the ones the report may not use, and it can be as expensive as the string makes it. A report is shared and
runs with the permissions of each viewer, so an unlock for administrators would also run for viewers who are not
administrators. QUERY(...) is therefore rejected for every user, administrators included, at its position.
Columns or Values and Groups
The panel Data asks what to Show:
- Numbers per group creates groups with calculated values, for example the number of cars per manufacturer.
- A list of elements creates one row per element with the columns you pick. Nothing is summarized.
A list report offers Add column, up to 50 columns. Drag a column to reorder the columns.
A summary report offers the following settings.
- Group by names up to 3 fields (Add grouping). Drag the values and the group fields to reorder them. The first value orders the groups and is the one charts show. A pivot table keeps the 20 columns with the largest absolute first value (for dates with Show periods without elements the first 20 periods) and folds the rest into Other. The first group field forms its rows. Without a field the values are calculated over all matching elements and the report shows a single number.
- Values are calculated per group. Count counts the matching elements. Sum, Average, Min and Max need a number field of the data itself (not of a related object), Min and Max also work for dates. A report has up to 10 values.
- Date fields are grouped by day, week, month, quarter or year. The buckets start in the time zone of the server. Show periods without elements (off by default) fills the timeline: every period from the first to the last period with data in the report is shown, the same under every parent group, with count 0, sum 0 and empty average, minimum and maximum. Filters do not extend that range. It is not available for a date field of related objects, with Top, when the groups are not ordered by the period or below a larger period of the same date field (year, then month). The periods count toward the group limit, so a very long range in days is refused: use a larger unit. A pivot table with the dates in its columns shows the first 20 periods in order and sums the rest into Other; a line chart shows up to 100 periods and a dashboard tile the first 10 rows. This is not Show elements without a value, which keeps the group of elements without a date.
- Number fields are grouped by their Exact value, by an Interval (groups of equal width, for example 0 – 1000,
1000 – 2000; an Offset shifts their starts) or by Ranges between boundaries (for example
0, 100, 1000gives < 0, 0 – 100, 100 – 1000 and ≥ 1000). A group includes its start and excludes its end. Groups without elements are not shown. Values outside all ranges form one group Other after the ranges. Own labels, gaps between ranges and closed outer ranges are set in the configuration, see Report Configuration Schema. Fields of related objects are grouped by their exact value. - Show as places a group field in the rows or in the columns of a pivot table. A second group field is shown as columns by default.
- Show elements without a value keeps the groups of elements that have no value in a group field. The switch is off by default and these groups are hidden. The totals and the viewer still know about these elements, see Viewing Reports. For a group field of related elements, this group holds the elements none of whose related elements has a value, each once; an element with a related element that has a value is only in the group of that value.
- Label replaces the name of a group field or a value in the result.
Long text fields cannot be grouped. Filter them with contains instead.
Averages that are combined across the groups of a related object, for example the average price per manufacturer country, are calculated from the sum and the number of values, never as an average of averages.
Sort and Limit
List reports sort by up to 5 columns and set the number of rows per page, from 1 to 1000. Long text fields, relation fields, fields with several values and fields of related objects cannot be sorted. Elements without a value, and elements with an empty text, sort last in both directions.
Summary reports limit and order every group field separately:
- Show only the top keeps the given number of groups, at most 10000. Without a limit the report returns all groups, up to the group limit.
- Order sorts the groups by the field value, alphabetically by the shown label, or by one of the values of the report in ascending or descending order. Date groupings and number groupings sort by value by default, other groupings by the first value of the report, largest first.
Fields and Lookups
Every panel offers the fields of the chosen data in a searchable, grouped picker. A field path identifies a field:
| Path | Meaning |
|---|---|
name | A field of the class, or a system field such as fullPath or creationDate. |
attributes.Engine.power | A field of an object brick. |
manufacturer.country.name | A field of a related object, up to two relations deep (lookup). |
parent.orderDate | A field of the parent object, when all parents share one class. |
cs:technicalAttributes.3.12 | A classification store key: store field, group id and key id. |
size.minimum, season.start | The bounds of a numeric, quantity value or date range. |
newsletter.consent | Whether a consent was given. |
workflow:product_workflow.place | The current place of a workflow. |
metadata.copyright | An asset metadata field. |
fileSize, width, mimetype | System fields of assets. |
title, description | System fields of documents. |
The Preview column shows the thumbnail of an asset in a list report, as the asset grid of Studio does: for the
asset data itself (preview) and for the image, hotspot image, gallery and asset relation fields of the data
(mainImage.preview, the first asset of the field). A click on it opens the asset, not the click action of the row.
The cell stays empty for an empty field, a deleted asset or an asset you may not view. It is not offered through
relations, in filters, groups or sort, nor in summary reports. The CSV export and the MCP preview give the full path of
the asset. A list page has up to 1,000 rows, each with one thumbnail per preview column: use a smaller Rows per
page for several preview columns.
Relations to documents offer the fields of the related document. Relations to assets offer the file name (key),
MIME type, file size, dimensions, dates and the indexed metadata of the asset, not its id, path, owner or tags.
Asset metadata is offered once, under the label configured in the asset metadata class definition, and only for the
asset relations of the data itself, not for assets reached through a related object or the parent.
Relations that allow several element types offer no lookups; their ids can be filtered, grouped and listed. Lookups
into the fields of related objects are offered for relations limited to exactly one class. A relation to several
classes or to any class offers the relation itself and the system fields id, key and path of the related
objects. An image field logo offers logo.width, logo.fileSize and the indexed metadata of the image.
The system field className is labelled Object class. Fields of the parent object appear in the picker under
More fields.
Field, class and option titles, the names of the system fields, country and language names and the labels of options providers are shown in the Studio language of the viewing user; stored values, filters, groups and drill-downs always use the raw values.
The picker lists the fields the Report Builder can query in the Generic Data Index. Field collections and blocks are not reportable in this version; the picker does not offer their fields, nor images (other than their asset fields), geographic types, links and URL slugs. Reverse object relations are relations to the objects that point to the element and offer the fields of their class. Data types of other bundles appear when the bundle registers a field type handler, see Configuration and Integration.
For data with more than 5000 fields, for example a class with thousands of classification store keys, the picker lists the first 5000 and says so; its search covers all fields.
Quantity Values
A quantity value field is shown, filtered and calculated in one unit, the report unit. When all values of the field that the user may view are stored in one unit, that unit is the report unit, also when it is not the default unit. Otherwise it is the default unit of the field, else its first valid unit; the picker shows this unit next to the field. Values without a unit do not count for this choice, and the report's filters do not change it. A field without default unit and valid units has no report unit, and its values are compared as stored.
- Filters compare values with their unit. A value stored in another unit matches when Pimcore can convert it into the
report unit (same base unit, factor and offset, no custom converter), after conversion:
weight > 1with report unit kg matches 1500 g. Values in a unit without such a conversion match no value condition (>,=,between, ...), and match the negated ones (≠,not in). Values without a unit count as the report unit. - Converted values compare with a tolerance of a billionth, so 0.7 kg matches 700 g.
- Sums, averages, minimums, maximums, groups and sorting use the stored numbers. When the values are stored in several units and the report contains values in another unit than the report unit, also a convertible one, it is refused with a message that names the report unit, so units never mix. Filter the report to elements with values in the report unit, or store the values in one unit.
- Quantity values that allow several units are not offered as fields of related elements or of the parent, and not in the advanced filter (PQL), because these read the stored numbers without their unit.
- Lists show values in the report unit as numbers with the unit in the column, and values in another unit with their
own unit, for example
500 g. - Input quantity values (text with a unit) are text fields; filters compare the text of values in the report unit.
Grouping by a field of a related object groups by the related object and merges groups with the same value. Elements that relate to several objects with the same value count once per related object, and the viewer shows a notice.
Localized fields use the language of the report. The language is the user language when the user may view it, else
the first language the user may view (en if there is none), unless the configuration sets language. The Report
Builder has no fallback logic of its own: groups, filters, sorts and lists use the values as the Generic Data Index
holds them, and the index stores the value of the fallback language chain where the chosen language is empty, like the
grids of Pimcore Studio. A group "Artikel" can therefore hold objects that have no value of their own in the language.
See Permissions and Limits.
Parameters
The report definition has no separate section for parameters. A parameter belongs to a filter:
- Open a filter and switch on Viewers can change this value. The value of the filter is the default. The filter is tagged Viewer can change.
- Set a Label for viewers and a Name. The editor proposes the name from the last part of the field path, for
example
nameformanufacturer.country.name. The name identifies the parameter for drill-downs from other reports. It starts with a letter, contains letters, digits and_and has up to 64 characters. Renaming a parameter breaks the mappings of drill-downs that pass a value to it. - Switch on Viewers must choose a value for a required parameter. The viewer does not run the report until the value is set.
- Switch off Viewers can change this value to turn the parameter back into a plain filter. The default becomes the fixed value. A parameter without a default stays, because the filter would not filter anything.
Removing a filter removes its parameter and the click mappings of the same report that pass it ($param.<name>).
Mappings in other reports stay and need to be adjusted there. A parameter that no filter uses is rejected when the
report is validated and when it is saved with the MCP tool save_report. The save in Pimcore Studio does not
validate, so the builder shows the error and the report stays a draft.
In the viewer a parameter shows a searchable list of the values present in the data. The editor tells this next to the name of the parameter. See Viewing Reports.
A report has up to 20 parameters.
On Click
Click actions make a result navigable.
- Select Add click action.
- Choose what is clicked: a value of a column or group field, or a row.
- Choose what opens: The element or Another report.
- For another report, choose the report. The editor lists the parameters of that report and proposes a fitting value for each one. Change the value or choose Not passed; a parameter that is not passed opens unfiltered.
A click on a relation field of a summary report, or on a row of a list report, can open the element. The viewer opens only elements the user may view and only reports shared with the user.
A report has up to 10 click actions.
Values for the Parameters of the Target
- The clicked value (
$value): the value of the clicked cell or group. Click on a value. - The clicked label (
$label): the text shown for the clicked cell or group. For a number parameter it is converted to a number ("1665"becomes1665). Click on a value. - Value of a field in the row (
$row.<field path>): a value of the clicked row; the path must be a column of this report. Click on a value or a row. - Parameter X of this report (
$param.<name>): the value the viewer has set for the parameter<name>of this report, or its default. A cleared parameter passes nothing. The parameter must exist in this report. Click on a value or a row. - The clicked period (
$range): the first and last day of the clicked date group as[from, to], for abetweenparameter. Click on a value. - Start of the clicked period (
$from) and End of the clicked period ($to): one end of the clicked date group as a single date, forgte,lteoreqparameters. Click on a value. - Clicked number group: on a number group (interval or ranges) the same three options pass the group instead of
a period and are named The clicked range, Start of the clicked range and End of the clicked range.
$rangefills abetweenparameter with[start, end],$from(the start) agteand$to(the end) anltparameter. A number group includes its start and excludes its end, asbetweenon numbers does, so the target lists exactly the items of the group. A range that is open at one end passes only the closed side. Other and the group without a value have no drill-down.
The period options need a click on a date group field with a day, week, month, quarter or year
group, or on a number group field. List columns and other fields offer them neither in the editor nor in validation.
Both ends of a period are dates without a time, so lte includes the whole last day.
The viewer sends the current parameters of the clicked report with the click, so Parameter X of this report carries the filters of the source report into the target.
Pre-Mapping and Checks
- A new click action pre-maps the parameters of the target. A parameter on the clicked field gets the clicked value (or the clicked period for a date group, the clicked range for a number group), a parameter on a field below the clicked relation gets the clicked label, and a parameter on the same field as a parameter of this report gets that parameter. The select of a parameter lists only the options that fit it; a saved option that no longer fits is marked (does not fit).
- A required parameter of the target must be passed. A click action that leaves it out is not saved; the editor names the parameter.
- Every passed value is checked against the parameter of the target report: a
betweenparameter needs a period[from, to], aninparameter takes lists and aneqparameter a single value. Whole numbers are passed as integers. A value that does not fit answers the click with an error that names the option, the value, the parameter and the reason. - A mapping to a parameter that the target report no longer has is marked as outdated in the editor and fails the click with an error that names the parameter. Remove the mapping to fix the click action.
Visualize
- Automatic: a number when there is no group field, a line chart for a date group, a bar chart for one group field, a pivot table otherwise.
- Bar chart: one or two group fields. Falls back to the pivot table for more.
- Line chart: one or two group fields. The group field shown as rows is the x axis, the one shown as columns forms the series. A date group is the x axis while Show as is not set.
- Pivot table: a cross-tab. With two group fields, Show as decides: one in the rows and one in the columns is a cross-tab with row and column totals (the first forms the rows and the second the columns by default), both in the rows is a nested table with subtotals. The viewer shows the 20 largest columns by the first value and sums the rest into one column named Other. Restricted columns and the column of elements without a value are never part of Other, so a hidden value never ends up in a visible number. With another number of group fields the pivot table uses Show as of the group fields and shows subtotals and totals.
- Table: the same as the pivot table.
List reports always show a table. A chart with two group fields draws the first value only, the table shows all values.
