Icon

04.2 Multi-Page Report - Exercise

04.2 - Multi-Page Report

Learning objective: In this exercise you will generate a multi-page report using a loop. Inside the report, you will customize the header for each page using a flow variable.


Workflow description:

The same customer transaction data set from the demo is used in this exercise.

  1. The Excel Reader node reads the customer transaction data.

  2. The date column is processed by the Date&Time Processing metanode. This metanode retains the transactions on or later than 1-1-2019, and appends two columns: Year and Quarter.

  3. The quarterly total sale is generated by the Pivot node, with Year and Quarter as rows and the classes of StoreType as columns. The aggregation method is the sum of Price.

  4. Any missing values are replaced with zeros with the Missing Value node.

  5. A new column QuarterAndYear is created by joining Year and Quarter by the Expression node.

  6. The pivot columns are renamed as Online Store and Onsite Store by the Column Renamer node.

  7. The Quarterly Sale Trend component plots the quarterly sale data in a stacked area chart, and produces a report. Open the component for more details. The Report Template Creator node is connected to the bottom input port of this component, propagating the orientation and the size of the report.

  8. The generated report is saved to a PDF file by the Report PDF Writer node.

Activity I: Loop over customer groups
  1. Add a Group Loop Start node between the Date&Time Processing metanode and the Pivot node. Iterate over classes of the CustomerGroup column (CC1, CC2, and CC3).

  2. Add a Report Loop End node between the Quarterly Sale Trend component and the Report PDF Writer node. Check Insert page break between reports so that each customer group is reported on a separate page.


Activity II: Adding the customer group in the report header

The instructions for this Activity is provided inside the Quarterly Sale Trend component. Open the component and complete the Activity.



Readingcustomer transactiondata
Excel Reader
Create a new column as a combination:"Year/Quarter"
Expression
Groups: Quarter, YearPivot: StoreTypeAggregation: sum of Price
Pivot
Replace missing valueswith zeros
Missing Value
Processing the transactiondate column
Date&Time Processing
Renaming pivotcolumns
Column Renamer
Group Loop Start
Setting the size andthe orientation ofthe report
Report Template Creator
Generating a reportwith a header anda stacked area chart
Quarterly Sale Trend
Report Loop End
Saving the reportas a PDF file
Report PDF Writer

Nodes

Extensions

Links