In a cross report, there exists both horizontal expansion and vertical expansion of cells. An example of data bidirectional expansion is shown below:
2.1 Create a new data set
Create a new template and add dataset ds1 with SQL statement SELECT * FROM Sales_Volume.
2.2 Report design
According to the figure below, design the template and drag the data columns to the corresponding cells.
The data columns, cells and settings are as follows:
|A3||Region||Data setting is Group and expand vertically from top to bottom, other defaults|
|Data setting is Group and expand vertically from top to bottom, other defaults|
|C3||Product_types||Data setting is Group and expand vertically from top to bottom, other defaults|
|D2||Product||Data setting is Group and expand horizontally from left to right, other defaults|
|D3||Sales_Volume||Data setting is Group and expand vertically from top to bottom, other defaults|
Column header: Make Region, Salesperson and Product_Types expand vertically and grouped from top to bottom to realize a column header;
Row header: Make Product expand horizontally and grouped from left to right to realize a row header;
Data: Based on the concept of parent-child cell , the Sales_Volume will take Product_Types as the left parent cell and Product as the upper parent cell ,and match corresponding salesman and product type automatically.
Note: The Sales_Volume has a one-to-one mapping with Salesperson and Product, so just drag Sales_Volume to the cell.
If the Sales_Volume corresponds to several Salesperson and Product, set the Data Setting of Sales_Volume as Summary-Sum. For details, refer to Data Display Mode - Data Setting.
2.3 Horizontal summation
Write the formula in cells that needs to be summarized:
|E3||=sum(D3)||The left parent is C3, the other default|
|F3||=sum(D3)||The left parent is B3, the other default|
The F3 cell is used to summarize the salesperson's sales volume regardless of product type. Simply set the F3's left parent to B3 to sum the salesperson's sales volume.
3. Effect preview
After saving, click on the Pagination preview to see the effect.
Note: If the data in column F is displayed on the next page during preview, you need to adjust the column width of the cell or adjust the paper size. For details, please refer to the Page Setup.
4. Completed template
For completed templates, refer to %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Primary\CrossReport\Cross_Report-Data_Bidirectional_Expansion.cpt.