Adding totals and subtotals to PixelPerfect reports
You can add totals to columns in a PixelPerfect report with at least one table. If the report has nested levels, you can add subtotals for some levels.
Create new PixelPerfect report
Do the following:
- Select Reports in the Qlik NPrinting main menu, and then click Create report.
- Enter a Title for the report. Report with Totals and SubTotals on levels.
- Select PixelPerfect from the Type drop-down list.
- Select an app from the App drop-down list.
- Click Create to create the report.
- Click Edit template to open the Template Editor.
Add levels to template
Do the following: Right-click the Levels node, and select Add levels.
Select object for level
Do the following:
- Select the Connection to the QlikView document that contains the object you want.
- Select CategoryName from the objects list.
- Click OK.
Begin nesting levels
Do the following:
- Right-click the CategoryName_Level node, and then select Add levels.
Select object for sublevel
Do the following:
- Select the Connection to the QlikView document that contains the object you want.
- Select the CH184 - Top 10 Products chart.
- Click OK.
Begin creating levels in templates
Do the following:
- Right-click in the Detail area.
- Select Insert Detail Report.
- Select “CategoryName_Level”.
Embed field in Detail1 band
Do the following:
- Click and drag the CategoryName node token from the Levels hierarchy, and drop it into the Detail1 open template area.
Format category heading
Do the following:
- Drag the label left and right borders to cover the entire width of the range from margin to margin.
- Set the font to Arial, 16pt, Bold, Centered, or format it as is appropriate for a category heading.
Create the CH184 sublevel
Do the following:
- Right-click on the DetailReport - "CategoryName_Level" bar.
- Select Insert Detail Report.
-
Select “CH184_Level”.
The DetailReport1 - CategoryName_Level.CH184_Level” bar appears.
Add group header
Do the following:
- Right-click on the DetailReport - “CategoryName_Level.CH184_Level” bar.
- Select Insert Band.
-
Select GroupHeader.
The GroupHeader1 bar appears.
Add group footer
Do the following:
- Right-click on the DetailReport - “CategoryName_Level.CH184_Level” bar.
- Select Insert Band.
-
Select GroupFooter.
The GroupFooter1 bar appears.
Embed headings in template
Do the following:
- Expand the CH184_Level.
- Press the Ctrl or Shift key and select the following fields in the following order specified: ProductName, Total Sales, Gross Profit and GP%.
- Release the Ctrl or the Shift key.
- Right-click the selected fields, then drag and drop them into the GroupHeader1 range so that the upper border of the fields is aligned with the lower border of the GroupHeader1 bar.
Qlik NPrinting automatically creates a table with the column names in the selected order.
Format heading text and boarders
Do the following:
- Select the entire header table in GroupHeader1.
- Format the text Arial, 16px, Bold, Centered, or as appropriate.
- Select the Borders option in Property Grid in the lower left pane.
- Open the drop-down list by clicking on the down-pointing triangle at the right of the field.
- Click on All to render all cell borders visible.
- To eliminate the white space between the headings and the data in the final report, drag the Detail2 bar upper border until it reaches with the lower border of the GroupHeader1 border.
Embed data in template
Do the following:
- Press the Ctrl key and select the following fields from “CH184_Level” in the following order: ProductName, Total Sales, Gross Profit and GP%.
- Release the Ctrl key.
- Left click and drag the collection of highlighted data fields and drop them into the Detail2 range so that the upper border of the fields are aligned with the lower border of the Detail2 bar.
Qlik NPrinting automatically creates a table with the tags for the columns of data in the order that they are selected.
Format data in template
Do the following:
- Select the entire row of data field tags.
- Format them to Arial and 12pt.
Render borders visible and eliminate white space
Do the following:
- Select the Borders option in Property Grid in the lower left pane.
- Open the drop-down list by clicking on the down-pointing triangle at the right of the field.
- Click on All to render all cell borders visible.
- Deselect the top border.
- To eliminate the white space between the footer and the data in the final report, drag the GroupFooter1 bar upper border until it reaches the lower border of the Detail2 range border.
Open table cell tasks and Format string editor
Do the following:
- Select the CH184_Level.Total Sales cell by clicking on it.
- Click on the small arrow above the upper right corner of the cell.
- Click on the browse button at the far right of the Format String field.
Format CH184_Level.Total Sales and CH184_Level.Gross Profit cell
Do the following:
- Select Currency.
- Select Custom.
-
Enter $ 0.
You can use one of the preset formats or create a custom one.
- Click OK.
- Right-justify the text.
- Repeat steps 1-5 for the CH184_Level.Gross Profit cell.
Format CH184_Level.GP% cell
Do the following:
- Select the CH184_Level.GP% cell.
- Open the Format string editor.
- Select Percent.
- Click on 0.00%.
- Click OK.
- Right-justify the text.
Start creating subtotals
Do the following:
- Press the Ctrl key and select the following fields from “CH184_Level” in the following order: Total Sales and Gross Profit.
-
Release the Ctrl key.
Both fields in the level are selected.
- Drag the collection of highlighted data field node tokens into the GroupFooter1 range so that the upper border of the fields are aligned with the lower border of the GroupFooter1 bar.
Adapt cells
Do the following:
- Drag the left border of the CH184_Level.Total Sales cell and the right border of the CH184_Level.Gross Profit cell in GroupFooter1 until they line up with those of the corresponding cells in Detail2.
Open summary editor for CH184_Level.Total Sales cell
Do the following:
- Select the CH184_Level.Total Sales cell in GroupFooter1.
- Click on the small arrow above the upper right corner of the cell.
- Click on the browse button at the far right of the Summary field.
Set summary running and open Format string editor
Do the following:
If necessary, open the Summary function drop-down list, and then click on Sum.
With this menu, you can set the summary function from the available list.
-
Set the Summary Running radio button to Group.
This sets the level for which the summary function is calculated.
- Click on the browse button at the far right of the Format string field.
Format cell content and close
Do the following:
- Select Currency.
- Select the Custom tab.
- Choose the $0 format.
- ClickOK.
-
Click OK again.
Note that the cell content has become Sum([CH184_Level.Total Sales]).
- Repeat steps from step 1 of Open summary editor for CH184_Level.Total Sales cell to the previous step for the CH184_Level.Gross Profit cell.
Format subtotal cell content
Do the following:
- Select the two subtotal cells by drawing a rectangle that includes both while holding the left mouse button down.
- Format the text as Arial, 12px, Bold, Right justified.
Render subtotal cell borders visible and eliminate white spaces
Do the following:
- Select the Borders option in Property Grid in the lower left pane.
- Open the drop-down list by clicking on the down-pointing triangle at the extreme right of the field.
- Click on All to render all cell borders visible.
- Deselect the top border.
- To eliminate the white space below the footer in the final report, drag the GroupFooter1 range lower border till it coincides with the lower border of the subtotal cell lower border.
Begin creating reports totals
Do the following:
- Right click on the DetailReport - "CategoryName_Level" bar.
- Select Insert Band.
- Select ReportFooter.
The ReportFooter1 bar appears.
Copy and paste subtotal cells
Do the following:
- Select both sum cells in GroupFooter1, and then copy the cells by pressing Ctrl+C.
- Paste the cells into ReportFooter by selecting the ReportFooter range, and then pressing Ctrl+V.
Open summary editor
Do the following:
- Select the Sum([CH184_Level.Total Sales]) cell in ReportFooter.
- Click on the small arrow above the upper right corner of the cell.
- Click on the browse button at the far right of the Summary field.
Set summary running and open Format string editor
Do the following:
- Set the Summary Running radio button to Report.
- Click on the browse button at the far right of the Format string field.
Format cell data content
Do the following:
- Select Currency.
- Select the Custom tab.
- Choose the $0 format.
- Click OK.
Close summary editor
Do the following:
- Click OK.
- Repeat the process from Open summary editor for the Sum([CH184_Level.Total Sales]) cell in ReportFooter.
Format report total cell contents
Do the following:
- Format the text as Arial, 14px, Bold,Right justified.
- Select the Borders option in Property Grid in the lower left pane.
- Open the drop-down list by clicking on the down-pointing triangle at the extreme right of the field.
- Click All to render all cell borders visible.
-
To eliminate the white space at the bottom of the report, drag the ReportFooter range lower border up to coincide with the Report Total cell lower border.
Preview and save
Do the following:
- Click Preview.
- Check the report, close it, and then edit the template again if necessary.
- Click Save and Close to save the template and close the Template Editor.