Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
It is possible to conditionally include/exclude content in a single NPrinting template based on data filters. This is applicable to all filter types (Task, Report, User,Object) as well as cycling and on-demand scenarios.
The technique is 100% dependent on the fact that if content exists inside a level, and the level evaluates to no values, the content is ignored during report generation.
If we add a data island to the QlikView or Qlik Sense source application that evaluates to a single or no values depending on filter conditions, then we can control whether a report is generated with or without content inside the level in the report template.
In the first part of this article we setup a report template to conditionally hide and show different content from the same report template depending on an on-demand selection or an NPrinting filter. The report template will have multiple app objects : pie chart, table chart etc... and a field selection will determine where the NPrinting report will include or exclude the chart.
In the second part we extend the technique to leverage the 'pages' feature as well so that we can not only conditionally include/exclude content but essentially design multiple whole reports in a single NPrinting template and generate different reports template. This allows us to condense styling and layouts and centralize code into a single template. That reduces the number of templates that need to be deployed and reduces change management updates making for a more scalable deployment model.
The following screen print shows a Qlik Sense Dashboard that contains an an NPrinting On-Demand report:
In this dashboard there is a data model field "Chart" showing 2 data values (Pie,Table) through a Filter Pane called "Chart Selection".
Upon selection of "Pie" a Pie is shown in the dashboard as follows
When the user clicks 'Run Report' , the selections are passed to NPrinting , including the selection Chart='Pie'. Upon completion the on-demand executions pane shows a download icon
..and when opened NPrinting has included the same pie chart filtered correctly.
Likewise, if the user were to change the field selection to Chart='Table' and submit a new on-demand request (They may also change other selections such as the Names....
..and after downloading the result of the new execution...
The Report is generated with the Table
In order to create this sample the following are required:
1. November 2018 Qlik Sense. These techniques use the On-Demand button included in the dashboard bundle with November 2018 Qlik Sense
2. A new data model field that includes names of the different App Objects to include (or exclude).
3. Associations to additional data model fields that include just one value (one field with one value per App Object)
4. NPrinting levels in the Report Template (one per App Object)
5. Report Template Error handling enabled
The new data model fields and associations can be seen in the following screen prints:
The ShowPie data model field is dedicated to the 'Pie' App Object and the ShowTable data model is dedicated to the 'Table' App object such that, associatively, ShowPie has NULL values if the user selects 'Table' for 'Chart' and ShowTable has NULL values if the user selects 'Pie' for 'Chart'
Whats
Now, author the NPrinting Report to include levels for each data model field dedicated to the App object (ShowPie,ShowTable). And place the 'Pie' App Object and the 'Table' App object within the respective level sections of the report.
Finally, enable the following report template property so that NPrinting does not error out when either LEVEL evaluates to NULL
This technique is valid in any Report Template where you use levels.
Attached is a sample that for reference. Note that the sample has other techniques around on-demand including how to conditionally show the On-Demand button only after filtering the data set to a limited number of records.
Since PowerPoint templates do not support levels, the technique is limited but still possible by using the 'pages' features which does work with the same techniques .
We can build on the technique to do design multiple 'whole' reports in a single template and generate different reports based on the same field selection technique . To do this, we must utilize the 'pages' feature in conjunction with the 'levels' feature documented above.
In the updated example below, the name and fields of the 'ChartControl' Table has been updated to reflect this intended to be a 'ReportControl' .
The associative logic eliminates Report1 or Report2 based on the selection in the 'Report' field.
In the associative model , the data island still uses a central control table with a group (two in this case) of single record boolean tables for each possible report
In the updated version of the report template below , a PAGE has been added based on the 'Report' Field in the 'ReportControl'
Some of the elements (in blue below) will include styling and content that is common to both reports. They can include dynamic objects, variables, formulas or 3rd party content.
Other elements ( green, orange) will be specific to each report.
When no filters / selections , the reports are paginated. Depending on the output and template this will result in page breaking , multiple sheets , multiple slide.
Otherwise , with just one Report selected, only the content necessary for the chosen report is included
For publish tasks, NPrinting Filters can be added in the NPrinting Web Console , through and Excel Import Task, or via the REST API.
Here the same two filters added in the NPrinting Console
Detailed Filter descriptions below
The filters can be used as a Task Filter, Report Filter, or User Filter to ensure the right users are sent the right reports at the right time using the same template.
In addition, you can build ALL the reports at once using the 'Cycle' feature.