Cell Dynamic Attributes-Parent Cell Practice
1. Overview
This article will详细介绍模板单元格中的"父格"功能及其配置使用方法。我们将通过一个具体的父格案例来展示如何有效实践。
本教程所使用的案例数据集如下:产品培训演示数据集.xlsx
父格的视频讲解,详见动态属性-父格。
1.1. Application Scenarios
When you need to display corresponding data based on the expansion records of cells to the left or above, you need to use the parent cell functionality, which is the cell C attribute (Context). Parent cells serve a one-to-one following role in this case.
1.2. Function Introduction
When defining multiple fields from a data source in a template layout, a relationship is established between them, called a parent-child relationship. Based on this relationship, when expanding in the final report, data will be filtered or grouped. The C attribute (Context) is used here to define parent cells.
Parent cells have the following 2 constraint effects on child cells:
-
Filtering: Child cells use parent cell data as filtering conditions for calculation. Filtering only takes effect on fields in the same view as the parent cell.
-
Following: Child cells follow the parent cell's expansion direction for synchronous expansion. Child cells can be fields from the same view as the parent cell, or static constant values and Excel formulas.
Parent cells provide the following three methods:
- Default Parent Cell (No C Attribute):
- Basic Excel Component: The nearest template cells to the left and above are the default left parent cell and upper parent cell for the current cell;
- Accelerated Excel Component: Horizontally adjacent up and down or vertically adjacent left and right, no default parent cell relationship;
Note: For differences between basic and accelerated version functionality, see [Product Behavior Change Description](../../../../../../2-Product Release Notes/1-2024 Year/1-V7.0.0 Important Feature Updates/1-Product Behavior Change Description.md#1.3. Chinese-style Reports Pro underlying Excel component upgraded from basic to accelerated version).
-
No Parent Cell (C=None): Simply lists data without corresponding relationships between fields;
-
Custom Parent Cell (C=cell1*cell2): Can specify 1 to 2 cells as parent cells, and the expansion directions of the 2 parent cells cannot be the same. It's recommended to click "Recommended Parent Cell" to get parent cells, and manually set parent cells when not accurate. For a specific cell, only cells to the left or above can be set as its parent cell.
1.3. Case Effects
Effect of setting parent cell:

Effect of not setting parent cell:

2. Operation Steps
2.1. View Fields
-
Drag the required view fields into the corresponding cells.
-
Double-click to open dynamic attributes and set parent cells according to requirements.
- B2, C2 use default parent cells (default parent cells are template cells to the left and above the cell).
- D2's parent cell is set to B2.
2.2. Regular Cells
First enter text or Excel formulas, then use right-click to convert to template cells, and finally double-click to open dynamic attributes and set parent cells.

3. Notes
-
When multiple dimensions are adjacent, they automatically inherit parent cells from left to right and top to bottom layer by layer. Numeric fields only need to set adjacent template cells as parent cells to achieve multi-condition filtering;
-
Empty cells, constants, and formulas with equal signs cannot become effective parent cells for other cells because they cannot actively expand themselves;
-
When the parent cell is a merged cell, you need to select the first cell in the merged range as the parent cell;
-
Circular settings are not allowed, that is, setting A's parent cell as B, B's parent cell as C, and C's parent cell as A again. When circular settings occur, it's considered an error and the report cannot be previewed or saved.
-
The constraint effect of parent cells on child cells is limited to the same view. Parent-child relationships across views are not allowed to save; if cross-view queries are needed, multiple views need to be associated into one view before setting parent cells; static cells and Excel formulas do not come from views, so parent cells can be set to any view field.