Report page generation method and device and readable storage medium
By determining the hierarchical relationship between parent and child cells and the scope of the control area, an extended cell model is constructed, which solves the problem of insufficient identification of parent-child cell relationships in report design, realizes the accurate and efficient generation of complex reports, and improves generation efficiency and logical consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YONYOU NETWORK TECH CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, report design lacks the ability to identify and process the parent-child relationship between cells within the row header, which makes it impossible to meet the needs of complex report scenarios such as cross-parent and cross-parent tables. Furthermore, it lacks a unified model architecture to support the full-process extension logic and cannot accurately control the scope of parent cell jurisdiction and merging rules.
By obtaining the list of cells to be extended and the design state information of the initial report page, the hierarchical relationship between parent and child cells and the scope of the control area are determined, an extended cell model is constructed, cells that need to be extended are selected and added to the queue, and finally the target report page is rendered, achieving precise control of the linkage extension of parent and child cells.
It breaks through the design limitations of row headers, column headers, and intersections, supports complex reporting scenarios such as cross-master-child tables and master-child cross-tables, ensures accurate and error-free parent-child cell linkage and extension, improves report generation efficiency, avoids invalid traversal and rule conflicts, and achieves structured storage and logical self-consistency of rules and data.
Smart Images

Figure CN122065796A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, and readable storage medium for generating report pages. Background Technology
[0002] In related technologies, when summarizing reports, the reports are based on the "row header-column header-intersection" design, which lacks the ability to identify and process the parent-child cell relationship between cells within the row header. When processing large amounts of data using row and column relationships, there is no unified model architecture to support the full-process extension logic, and it is impossible to accurately control the scope of parent cell jurisdiction and merging rules, which makes it impossible to meet the needs of complex reporting scenarios such as cross-master-child tables and master-child cross-tables. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] Therefore, the first aspect of the present invention proposes a method for generating report pages.
[0005] A second aspect of the present invention provides an apparatus for generating report pages.
[0006] A third aspect of the present invention provides another apparatus for generating report pages.
[0007] The fourth aspect of this application proposes a readable storage medium.
[0008] In view of this, a first aspect of the present invention provides a method for generating a report page, comprising: obtaining a list of cells to be extended and preset design state information of an initial report page; determining the parent-child cell hierarchy relationship of each cell in the list of cells to be extended, and the control area range of the cell and its relative child cell, based on the list of cells to be extended and the design state information; constructing an extended grid model containing the cell extension state according to the parent-child cell hierarchy relationship and the control area range; selecting cells to be extended and adding them to a queue according to the extended grid model to determine an extended table model; and rendering the target report page according to the extended table model and preset page rendering rules.
[0009] This application overcomes the design limitations of row headers, column headers, and intersections by processing data input, relationship determination, and model construction, followed by extended execution and finally outputting a rendered page. It supports complex report scenarios such as cross-parent and cross-parent tables. Simultaneously, it standardizes and ensures the self-consistency of report extension logic, guaranteeing accurate and error-free parent-child cell linkage extension. It also improves report generation efficiency, avoiding execution time consumption caused by invalid traversal and rule conflicts. Specifically, firstly, the design-state information obtained in this application includes parent cell configuration information, providing a rule basis for determining parent-child cell relationships. Secondly, based on the parent cell configuration and position coordinates in the design-state information, the list of cells to be extended is traversed to accurately identify the parent-child cell hierarchical relationship of each cell, clarifying the hierarchical control logic of cells within the row header. Finally, by recursively summarizing the coverage of child cells, the boundary of the parent cell's control area is determined, enabling the parent cell to accurately copy all child cells within its jurisdiction when extending, and the parent cells in the same row and column to be extended synchronously when extending child cells. This process enabled the reporting system to possess the core capability to handle parent-child cell relationships within row headers, successfully supporting complex scenarios that designs such as cross-master-child tables and master-child cross-tables could not meet.
[0010] In addition, this application constructs an extended grid model based on the parent-child grid hierarchical relationship and the control area range, structurally integrating scattered association rules, range boundaries, and cell states to avoid logical conflicts caused by rule fragmentation. Then, based on the extended grid model, cells requiring extension are selected and added to a queue, and the extension is executed in a unified order to ensure orderly progress. Next, during the extension process, the copy boundary is calculated based on the control area range. After copying an entire row or column, the hierarchical relationship of the copied cells is maintained using the original parent-child grid association rules. Simultaneously, a merge marker is added based on the merge rules in the design state information, ultimately summarizing and generating an extended table model. The entire process breaks down the extension logic into standardized steps, with each step using the design state information as a unified rule basis, ensuring that the parent-child grid linkage extension is complete and does not exceed boundaries, and that the merging effect is consistent with the design expectations.
[0011] Based on this, the list of cells to be extended in this application clearly defines the core objects for subsequent processing, avoiding the waste of resources caused by indiscriminately traversing all cells, and allowing the extension operation to focus only on the cells that need to be extended. On the other hand, the construction of the extension grid model and the extension table model realizes the structured storage of rules and data. When the extension is executed later, the relationships, control scope and other information in the model can be directly queried without repeatedly parsing the design-state rules.
[0012] This application's solution breaks down the complex report extension process into standardized multi-step steps. It provides unified rules through design-state information, clarifies core logic through parent-child relationships and control scope, and achieves structured integration of rules and states through a two-level model. This fundamentally solves the problems of scenario limitations, logical confusion, and inefficiency in report design. Data input forms the basis of rules, relationship determination forms the core logic, model construction forms the execution vehicle, extension execution forms the core operation, and rendering output forms the final result, forming a complete technical closed loop. Ultimately, this achieves accurate and efficient generation of complex, customizable reports.
[0013] In some technical solutions of this application, the design-state information includes at least cell merging information, position information, parent cell configuration information, and data source mapping information; wherein, the merging information is the downward merging size and the right merging size of the cell, the position information is the row or column coordinate of the cell in the original report template, the parent cell configuration information includes three types: explicitly set to NONE, default configuration, and explicitly specified parent cell, and the data source mapping information is the database table field association information corresponding to the cell.
[0014] In this technical solution, the merging information is a quantitative parameter that defines the cell merging rules. It includes the downward merging size and the rightward merging size, which respectively represent the number of adjacent cells that are continuously merged vertically and horizontally (when the value is 0, there is no merging), and are used to mark the range boundary of the merged cells.
[0015] Location information refers to the row or column coordinates of a cell within the original report template. It clarifies the initial position of the cell and provides spatial reference for determining parent-child cell relationships and calculating copy boundaries.
[0016] Parent cell configuration information refers to the preset rules for cell parent cell association, including three types: explicitly set to NONE (the cell has no parent cell and does not need to be associated), default configuration (automatically matches the parent cell or does not process it), and explicitly specify the parent cell (explicitly associates a specific target cell).
[0017] Data source mapping information is the relationship between cells and database table fields, which clarifies the source of the business data required by the cell and supports subsequent data list retrieval and extended data filling.
[0018] This technical solution provides a unified and accurate rule basis for subsequent parent-child cell relationship determination and control scope calculation by clearly defining the specific components of the design state information, avoiding the confusion of extension logic caused by ambiguous configuration information. Through quantified merging information and clear location information, it ensures that the merging effect and cell position are accurately transmitted during the extension process, solving the problem of table merging rule failure. Furthermore, through standardized parent cell configuration types and data source mapping rules, it improves the standardization and adaptability of report extension, supporting data querying and hierarchical relationships in complex scenarios.
[0019] First, the downward and rightward merge sizes in the merge information clearly define the cell merge boundaries during the design phase. This merge information is referenced in subsequent extension processes, ensuring that the merge rules are not broken when copying rows / columns. For example, if the downward merge size of the parent cell is 2, the merge range of the child cells after extension and copying will still be consistent with the parent cell, avoiding hierarchical display errors. Second, the row / column coordinates provided by the position information provide spatial logic support for determining parent-child cell relationships. For example, the parent cell of the default configured cell can be determined by searching for the expandable cell with adjacent coordinates to the left / up, ensuring the accuracy of the relationship determination. Third, the three clearly defined types of parent cell configuration information avoid the problem of ambiguous parent cell relationships. Cells explicitly set to "NONE" skip the association process directly, cells with default configuration are automatically matched according to position rules, and cells with explicitly specified parent cells are precisely associated with the target. These three rules cover all parent cell configuration scenarios, ensuring the self-consistency of hierarchical relationship logic. Finally, the data source mapping information establishes a connection between the cell and the database, enabling the subsequent extension process to accurately query the business data list (such as "Region 1, Region 2, Region 3"), providing a data foundation for dynamic extension and avoiding the inability to execute extensions due to unclear data sources.
[0020] In some technical solutions of this application, determining the parent-child cell hierarchy relationship of each cell in the cell list to be extended, and the control area range of the cell and its relative child cell, based on the cell list to be extended and the design state information, includes: traversing the cells in the cell list to be extended, combining the coordinate relationship between the parent cell configuration information and the position information in the design state information, and determining the parent-child cell hierarchy relationship of each cell; based on multiple parent-child cell hierarchy relationships, traversing the top-level cells where the parent cell is empty, if there are no child cells, setting the control area range to the cell itself, and if there are child cells, recursively summarizing the control areas of all child cells and their sub-child cells to determine the control area range of each cell and its relative child cell.
[0021] In this technical solution, the parent-child cell hierarchy is the hierarchical control logic between cells. Based on the parent cell's configuration information and position coordinates, the control and managed relationships between the parent cell and its direct children, as well as the children of children, are clearly defined, which is the core basis for the linked extension of parent and child cells. The control area is the coverage boundary of the parent cell over its governed children, that is, the range of rows / columns that need to be copied synchronously when the parent cell extends. When there are no children, it is the cell itself; when there are children, it is determined by recursively summarizing the coverage areas of all children and their sub-children. The top-level cell is a cell where the parent cell is empty and is the starting node for calculating the control area. Its jurisdiction covers the table area corresponding to all direct and indirect children. Recursive summarization is the core algorithm for calculating the control area. Starting from the top-level cell, it traverses its direct children and the children of their children layer by layer, accumulating the coverage areas of all governed cells, and finally determining the complete control boundary of the parent cell.
[0022] Specifically, in the parent-child cell hierarchy determination stage, the list of cells to be extended is first traversed, and the cells are categorized based on parent cell configuration information and position coordinates: For cells explicitly set to NONE, the association process is skipped to avoid invalid calculations. For cells with default configurations, it is determined whether they are in the first row / column of the original report template. If so, no parent cell is associated; otherwise, the first expandable cell is searched to the left / upper as the parent cell, ensuring the rationality of the default rules. For cells with explicitly specified parent cells, the target cell is directly matched according to the configuration, establishing a two-way association (the parent cell records the child cell identifier, and the child cell records the parent cell identifier), ensuring accurate association. This avoids the pain point of not being able to identify parent-child relationships within row headers and clarifies the hierarchical logic of all cells.
[0023] In the process of determining the control area, top-level cells with empty parent cells are first selected. Then, the control area is calculated based on whether child cells exist: For top-level cells without child cells, the control area is set to itself, ensuring clear extension boundaries for independent cells. For top-level cells with child cells, a recursive aggregation algorithm is used to traverse all direct child cells and child cells of child cells, accumulating the row / column range covered, and finally determining the complete control boundary of the parent cell. For example, if top-level cell C5 governs D4, D5, E4, and E5, its control area after recursive aggregation is from C5 to E5, ensuring that all governed child cells can be accurately copied during extension, achieving linked extension between parent and child cells.
[0024] In some technical solutions of this application, constructing an extended grid model containing the extended state of cells based on the parent-child grid hierarchical relationship and the control area range includes: structurally integrating the parent-child grid hierarchical relationship, control area range and extended state of each cell; recording the position information of each cell after expansion to form an extended grid model containing information related to the complete extension of the cells.
[0025] In this technical solution, the extended grid model is a structured data model that records the real-time state of a cell after it has been expanded. It integrates the parent-child grid hierarchy, the controlled area, and the expanded position information, serving as the core carrier connecting design-state rules and extended execution. Structured integration involves organizing and storing scattered parent-child grid relationships, controlled area ranges, and extended status information in a unified data format, forming a standardized data structure for easy retrieval and retrieval during subsequent expansion processes. The extended status is the cell's real-time extended attribute, including whether it has been expanded, the number of expansions, and its current expanded position. This information is used to mark the cell's expansion progress, preventing duplicate or missed expansions. The expanded position information is the cell's latest row / column coordinates on the report page after being expanded and copied, distinct from its original design-state position, ensuring accurate cell positioning during subsequent rendering.
[0026] First, the parent-child cell hierarchy, controlled area, and extension status of each cell are structurally integrated. This technical solution binds three types of information through a model. For example, the model of cell A1 simultaneously stores information such as "parent cell is none," "controlled area is itself," and "not extended." When filtering extendable cells later, the extension status in the model can be directly queried without repeatedly parsing design-state rules, significantly improving efficiency. The position information of each cell after expansion is recorded to ensure that the position of the cell during the extension process is traceable. For example, after the original cell A1 is extended and copied, the position information of the new cell is recorded as A2, and its parent-child cell hierarchy and controlled area remain consistent with the original cell. The model ensures accurate matching when maintaining parent-child relationships by associating the original identifier with the new position. For example, the copied child cell can quickly find its corresponding parent cell position through the model, avoiding the breakage of the association relationship. Furthermore, the structured extended grid model enables the subsequent extended execution process to form a "model-driven" closed loop: when selecting cells to be extended, the extended status and extendable identifiers in the model are used; when calculating the copy boundary, the control area range in the model is called; when maintaining the relationship, the parent-child grid hierarchy information in the model is queried. The entire process does not rely on scattered design state data, ensuring that the extended logic is coherent and the rule execution is accurate, ultimately achieving a clear hierarchy and accurate data extension effect for complex reports.
[0027] In some technical solutions of this application, the criteria for selecting cells that need to be extended are extended identifiers; among them, the extended identifiers are extended qualification marks determined based on the following three conditions: whether the data source mapping information in the design state information exists, whether the parent cell configuration information supports extension, and whether the length of the database query data list is greater than or equal to the preset length.
[0028] In this technical solution, the extendable identifier is a marker used to determine whether a cell is eligible for extension. It is a qualification credential derived from three core conditions in the design state information and is used to quickly filter cells that need to be extended. Data source mapping information defines the relationship between the cell and database table fields, clarifying the source of the cell's business data query and serving as the basis for determining whether a cell has the foundation for data extension. Parent cell configuration information represents the preset rules for cell parent cell associations (including three types: explicitly set to NONE, default configuration, and explicitly specified parent cell). The configuration types that support extension are the default configuration (not the first row / column) and explicitly specified parent cell. The database query data list is a set of business data (such as "Region 1, Region 2, Region 3") retrieved from the database based on the data source mapping information, and serves as the data source for cell extension. The preset length is the minimum data volume threshold set during the report design phase to trigger extension; the default value is 2, meaning that the data condition for extension is met only when the data list length is greater than or equal to 2.
[0029] First, the system checks if the data source mapping information exists. If the cell lacks data source mapping information, business data cannot be retrieved from the database, and therefore lacks the basis for extension, resulting in a direct determination of "no extension flag." If the information exists, the system proceeds to the next level of verification. Second, the system checks if the parent cell configuration information supports extension. That is, if the parent cell configuration is explicitly set to NONE, or is the default configuration and is in the first row / column, the cell has no parent cell association or does not need to be associated with a parent cell, lacking the logical basis for linked extension, and is determined to have no extension flag. If it is the default configuration (not in the first row / column) or an explicitly specified parent cell, the hierarchical association condition is met, and the system proceeds to the final verification.
[0030] Finally, the database query data list length is checked to see if it is greater than or equal to the preset length. If the data list length is less than 2 (e.g., containing only "Region 1"), all data can be displayed without expansion, and it is determined to have no expansion flag. If the length is greater than or equal to 2 (e.g., containing "Region 1, Region 2, Region 3"), the quantitative conditions for data expansion are met, and it is ultimately determined to have an expandable flag. Through these three layers of verification—data-based, logical-based, and quantitative-based—the core conditions required for expansion are fully covered, ensuring that the selected cells are all target objects with expandable data and logically expandable data, laying a precise foundation for subsequent expansion execution.
[0031] In some technical solutions of this application, based on the extended grid model, the cells to be extended are selected and added to the queue. Determining the extended table model includes: selecting cells with extendable labels in the order of row priority from top to bottom and column priority from left to right and adding them to the queue; taking out cells in the queue in sequence, if a cell has a parent cell, the parent cell is expanded first; calculating the copy boundary based on the coordinates corresponding to the size and location information of the controlled area, copying the entire row or column, and assembling to generate the extended row and column model; based on the original parent-child cell hierarchical association rules in the design state information, matching the copied cell identifier with the original cell identifier, and maintaining the parent-child cell hierarchical association relationship of the copied cell by combining the two-way binding of parent and child cells; then identifying the merging rules based on the merging information in the design state information and assigning merging marks to the cells to be merged, and summarizing to generate the extended table model.
[0032] In this technical solution, firstly, cells with extensible tags are filtered and added to a queue in a row-first, top-to-bottom, column-first, left-to-right order. This order aligns with the reading habits of basic reports and the display logic of business data, ensuring that upper-level cells extend first and cells at the same level extend from left to right, avoiding the logical confusion of "child cells extending before parent cells." Secondly, cells in the queue are retrieved sequentially for extension: if a cell has a parent cell, the parent cell is expanded first to ensure that the parent cell's jurisdiction is determined first, and the child cell can accurately match the parent cell's extension status when copying. Then, the copy boundary is calculated based on the size and location coordinates of the controlled area. For example, if the parent cell's controlled area is 3 rows and 2 columns, this area is used as a whole when copying to avoid the copy boundary exceeding the parent cell's jurisdiction and ensure consistent coverage between parent and child cells. Subsequently, the entire row or column is copied, assembled to generate an extended row and column model, and the copy status of all cells in that row / column is recorded. Next, the parent-child cell hierarchy of the copied cells is maintained: by mapping the copied cell identifier to the original cell identifier, the original parent-child cell rules in the design state information are matched. For example, if the original cell B1's parent cell is A1, the copied cell B2 will automatically be associated with the copied cell A2. Simultaneously, through two-way binding between parent and child cells, the parent cell records the child cell identifier, and the child cell records the parent cell identifier, ensuring that the hierarchy remains unbroken. Finally, based on the merging information in the design state information, merging rules are identified, and merging markers are assigned to the copied cells that need to be merged. For example, if the original cell A1 is merged downwards by a size of 2, the copied cells A2 and A3 are also simultaneously assigned this merging marker. Finally, all extended row and column models are summarized to generate an extended table model containing complete extended information, hierarchy relationships, and merging rules, providing unified data support for the rendering process.
[0033] In some technical solutions of this application, copying an entire row or column includes: querying the database based on the data source mapping information in the design state information to obtain the data list corresponding to the cell; assigning the first data in the data list to the original cell, and traversing from the second data in the data list; calculating the start and end positions of the copy based on the size of the controlled area and the position coordinates of the original cell, copying the entire row or column according to the start and end positions, and filling the currently traversed data into the copied cell; if the copied cell has an extensible identifier and is a sub-cell of the currently expanded cell, then adding the copied cell to the queue.
[0034] This technical solution achieves data filling accuracy, replication boundary accuracy, and hierarchical linkage extensibility through standardized data acquisition, replication range calculation, and queue dynamic update processes.
[0035] Based on the data source mapping information in the design state information, the database is queried to obtain the data list corresponding to the cell. The first data in the data list is assigned to the original cell, and the process starts from the second data. Taking the size of the controlled area as a whole and the position coordinates of the original cell as a whole, the start and end positions of the copy are calculated. The entire row or column is copied according to the start and end positions, and the data currently being traversed is filled into the copied cell. If the copied cell has an extensible identifier and is a child cell of the currently expanded cell, the copied cell is added to the queue. This continuous process ensures that the data of the original cell and the copied cell correspond one-to-one, the copy operation does not exceed the control area of the parent cell, and realizes the linkage effect of the parent cell extension driving the child cell extension, supporting the complete generation of complex hierarchical reports.
[0036] A second aspect of the present invention provides a report page generation apparatus, comprising a first acquisition module, a first determination module, a second determination module, a third determination module, and a first rendering module. The first acquisition module is used to acquire a list of cells to be extended and preset design state information of an initial report page. The first determination module is used to determine the parent-child cell hierarchy relationship of each cell in the list of cells to be extended, and the control area range of the cell and its relative child cell, based on the list of cells to be extended and the design state information. The second determination module is used to construct an extended grid model containing the cell extension state according to the parent-child cell hierarchy relationship and the control area range. The third determination module is used to filter the cells to be extended and add them to a queue according to the extended grid model to determine the extended table model. The first rendering module is used to render the target report page according to the extended table model and preset page rendering rules.
[0037] The report page generation device in this application constructs a complete technical closed loop of "data input - relationship determination - model building - extended execution - rendering output" through the modular collaborative operation of the first acquisition module, the first determination module, the second determination module, the third determination module, and the first rendering module. First, it overcomes the limitations of the "row header - column header - intersection point" design by accurately determining the hierarchical relationship between parent and child cells and the scope of the control area, efficiently supporting the report generation needs of complex business scenarios such as cross-parent and cross-parent tables. Second, relying on standardized model building and extension processes, it ensures accurate and error-free parent-child cell linkage extension, and that the merging rules are highly consistent with design expectations, making the report extension logic more self-consistent and the display effect more standardized. Third, modular division of labor reduces invalid calculations; the structured model-driven extension process reduces the time consumption of frequent cell insertion; combined with optimization algorithms such as Z-shaped filtering queues and recursive summarization, it significantly improves the generation efficiency of complex reports and shortens the execution cycle.
[0038] A third aspect of the present invention provides a report page generation apparatus, comprising a processor and a memory, wherein the memory stores a program or instructions, and the processor, when executing the program or instructions in the memory, implements the steps of the report page generation method as described in any of the above-described technical solutions. Therefore, the report page generation apparatus possesses all the beneficial effects of the report page generation method as described in any of the above-described technical solutions.
[0039] A fourth aspect of the present invention provides a readable storage medium storing a program or instructions, which, when executed by a processor, implement the steps of the report page generation method as described in any of the above-described technical solutions. Therefore, the readable storage medium possesses all the beneficial effects of the report page generation method as described in any of the above-described technical solutions.
[0040] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0041] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0042] Figure 1 This is one of the flowcharts illustrating a method for generating a report page according to an embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of a target report page according to an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram of the model relationships in a method for generating a report page according to an embodiment of the present invention;
[0045] Figure 4 This is a second flowchart illustrating a method for generating a report page according to an embodiment of the present invention.
[0046] Figure 5 This is a third flowchart illustrating a method for generating a report page according to an embodiment of the present invention.
[0047] Figure 6 This is a fourth flowchart illustrating a method for generating a report page according to an embodiment of the present invention.
[0048] Figure 7 This is one of the schematic block diagrams of a report page generation apparatus according to an embodiment of the present invention;
[0049] Figure 8 This is a second schematic block diagram of a report page generation device according to an embodiment of the present invention. Detailed Implementation
[0050] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0051] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0052] The following reference Figures 1 to 8 Methods, apparatus, and readable storage media for generating report pages according to some embodiments of the present invention are described.
[0053] like Figure 1 As shown, an embodiment of this application provides a method for generating a report page, the steps of which include:
[0054] Step 102: Obtain the list of cells to be expanded and the preset design state information of the initial report page;
[0055] Step 104: Based on the list of cells to be extended and the design state information, determine the parent-child cell hierarchy of each cell in the list of cells to be extended, as well as the control area of the cell and its relative child cell;
[0056] Step 106: Construct an extended grid model that includes the extended state of cells based on the parent-child grid hierarchical relationship and the control area range;
[0057] Step 108: Based on the extended grid model, filter the cells that need to be extended and add them to the queue to determine the extended table model;
[0058] Step 110: Render the target report page according to the extended table model and preset page rendering rules.
[0059] In the report page generation method provided by this invention, the list of cells to be extended is a set of cells in the initial report page that are pre-marked and expanded by copying rows / columns based on business data volume or parent-child cell relationships, thus clarifying the core object scope of subsequent extension processing.
[0060] Design-state information is the core configuration data preset during the report template design phase. It includes cell merging rules, original positions, parent cell association configurations, and data query association information, and serves as the rule basis for all subsequent extended operations.
[0061] The parent-child cell hierarchy is the hierarchical control logic between cells. A parent cell can govern its direct child cells and the child cells' child cells. When extending, the child cells within its jurisdiction need to be copied in conjunction with the parent cell. When a child cell extends, the parent cells in the same row and column need to be extended simultaneously.
[0062] The controlled area is the boundary of the parent cell's coverage of its governed child cells. That is, the range of rows or columns that need to be copied synchronously when the parent cell is extended. When there are no child cells, it is the cell itself. When there are child cells, it is the coverage area of all child cells recursively summarized.
[0063] The extended grid model is a structured data model that records the real-time state of a cell after it has been expanded. It integrates the parent-child cell relationships, the range of the control area, and the position information after expansion. It is the core carrier connecting design-state rules and extended execution.
[0064] The extended table model is a complete data model that summarizes the relationships, merging rules, and business data of all extended cells. It includes the extended row and column model and the final state of all cells, and is the direct data source for report page rendering.
[0065] Preset page rendering rules are the visualization standards set during report design, including font styles, alignment, and merged cell display logic, used to transform extended table models into visual report pages that meet business needs. For example... Figure 2 As shown, Figure 2 Page Y1 is the generated visualization report page, and the tables on the page include relevant statistics on regions, provinces, and annual revenue.
[0066] This application overcomes the design limitations of row headers, column headers, and intersections by processing data input, relationship determination, and model construction, followed by extended execution and finally outputting a rendered page. It supports complex report scenarios such as cross-parent and cross-parent tables. Simultaneously, it standardizes and ensures the self-consistency of report extension logic, guaranteeing accurate and error-free parent-child cell linkage extension. It also improves report generation efficiency, avoiding execution time consumption caused by invalid traversal and rule conflicts. Specifically, firstly, the design-state information obtained in this application includes parent cell configuration information, providing a rule basis for determining parent-child cell relationships. Secondly, based on the parent cell configuration and position coordinates in the design-state information, the list of cells to be extended is traversed to accurately identify the parent-child cell hierarchical relationship of each cell, clarifying the hierarchical control logic of cells within the row header. Finally, by recursively summarizing the coverage of child cells, the boundary of the parent cell's control area is determined, enabling the parent cell to accurately copy all child cells within its jurisdiction when extending, and the parent cells in the same row and column to be extended synchronously when extending child cells. This process enabled the reporting system to possess the core capability to handle parent-child cell relationships within row headers, successfully supporting complex scenarios that designs such as cross-master-child tables and master-child cross-tables could not meet.
[0067] In addition, this application constructs an extended grid model based on the parent-child grid hierarchical relationship and the control area range, structurally integrating scattered association rules, range boundaries, and cell states to avoid logical conflicts caused by rule fragmentation. Then, based on the extended grid model, cells requiring extension are selected and added to a queue, and the extension is executed in a unified order to ensure orderly progress. Next, during the extension process, the copy boundary is calculated based on the control area range. After copying an entire row or column, the hierarchical relationship of the copied cells is maintained using the original parent-child grid association rules. Simultaneously, a merge marker is added based on the merge rules in the design state information, ultimately summarizing and generating an extended table model. The entire process breaks down the extension logic into standardized steps, with each step using the design state information as a unified rule basis, ensuring that the parent-child grid linkage extension is complete and does not exceed boundaries, and that the merging effect is consistent with the design expectations.
[0068] Based on this, the list of cells to be extended in this application clearly defines the core objects for subsequent processing, avoiding the waste of resources caused by indiscriminately traversing all cells, and allowing the extension operation to focus only on the cells that need to be extended. On the other hand, the construction of the extension grid model and the extension table model realizes the structured storage of rules and data. When the extension is executed later, the relationships, control scope and other information in the model can be directly queried without repeatedly parsing the design-state rules.
[0069] For example, when filtering cells that need to be extended, the system can quickly locate them based on the status indicators in the extended cell model, without having to traverse the original cell list again. When copying rows / columns, the system can directly call the control area range data in the model to calculate the copy boundary, avoiding redundant calculations. At the same time, the standardized extension process reduces backtracking and corrections caused by rule conflicts, significantly reducing the overall execution time of report generation.
[0070] This application's solution breaks down the complex report extension process into standardized multi-step steps. It provides unified rules through design-state information, clarifies core logic through parent-child relationships and control scope, and achieves structured integration of rules and states through a two-level model. This fundamentally solves the problems of scenario limitations, logical confusion, and inefficiency in report design. Data input forms the basis of rules, relationship determination forms the core logic, model construction forms the execution vehicle, extension execution forms the core operation, and rendering output forms the final result, forming a complete technical closed loop. Ultimately, this achieves accurate and efficient generation of complex, customizable reports.
[0071] like Figure 3 As shown, Figure 3 The presentation shows the hierarchical relationship of the four-layer model in the process of report extension: the outermost layer is the "Extended Table Model", which contains the middle layer "Extended Row and Column Model"; the "Extended Row and Column Model" contains the "Extended Grid Model"; and the innermost layer is the "Design State Model".
[0072] Logically, the transformation relationship between design state configuration, extended state, and final table structure is as follows: the design state model (bottom layer) provides the original configuration information of the cells, and based on this, an extended cell model that records the real-time extended state of the cells is generated; multiple extended cell models are integrated into an extended row and column model by row or column; finally, all extended row and column models are summarized into an extended table model that supports report rendering.
[0073] In some embodiments of this application, the design state information includes at least cell merging information, position information, parent cell configuration information, and data source mapping information; wherein, the merging information is the downward merging size and the right merging size of the cell, the position information is the row or column coordinates of the cell in the original report template, the parent cell configuration information includes three types: explicitly set to NONE, default configuration, and explicitly specified parent cell, and the data source mapping information is the database table field association information corresponding to the cell.
[0074] In this embodiment, the merging information is a quantitative parameter that defines the cell merging rules, including the downward merging size and the rightward merging size, which respectively represent the number of adjacent cells that are continuously merged vertically and horizontally (a value of 0 indicates no merging), and are used to mark the boundaries of the merged cells.
[0075] Location information refers to the row or column coordinates of a cell within the original report template. It clarifies the initial position of the cell and provides spatial reference for determining parent-child cell relationships and calculating copy boundaries.
[0076] Parent cell configuration information refers to the preset rules for cell parent cell association, including three types: explicitly set to NONE (the cell has no parent cell and does not need to be associated), default configuration (automatically matches the parent cell or does not process it), and explicitly specify the parent cell (explicitly associates a specific target cell).
[0077] Data source mapping information is the relationship between cells and database table fields, which clarifies the source of the business data required by the cell and supports subsequent data list retrieval and extended data filling.
[0078] This embodiment provides a unified and accurate rule basis for subsequent parent-child cell relationship determination and control scope calculation by clearly defining the specific components of the design state information, avoiding the confusion of extension logic caused by ambiguous configuration information. Through quantified merging information and explicit location information, it ensures that the merging effect and cell position are accurately transmitted during the extension process, solving the problem of table merging rule failure. Furthermore, through standardized parent cell configuration types and data source mapping rules, it improves the standardization and adaptability of report extension, supporting data querying and hierarchical association in complex scenarios.
[0079] First, the downward and rightward merge sizes in the merge information clearly define the cell merge boundaries during the design phase. This merge information is referenced in subsequent extension processes, ensuring that the merge rules are not broken when copying rows / columns. For example, if the downward merge size of the parent cell is 2, the merge range of the child cells after extension and copying will still be consistent with the parent cell, avoiding hierarchical display errors. Second, the row / column coordinates provided by the position information provide spatial logic support for determining parent-child cell relationships. For example, the parent cell of the default configured cell can be determined by searching for the expandable cell with adjacent coordinates to the left / up, ensuring the accuracy of the relationship determination. Third, the three clearly defined types of parent cell configuration information avoid the problem of ambiguous parent cell relationships. Cells explicitly set to "NONE" skip the association process directly, cells with default configuration are automatically matched according to position rules, and cells with explicitly specified parent cells are precisely associated with the target. These three rules cover all parent cell configuration scenarios, ensuring the self-consistency of hierarchical relationship logic. Finally, the data source mapping information establishes a connection between the cell and the database, enabling the subsequent extension process to accurately query the business data list (such as "Region 1, Region 2, Region 3"), providing a data foundation for dynamic extension and avoiding the inability to execute extensions due to unclear data sources.
[0080] In some embodiments of this application, determining the parent-child cell hierarchy of each cell in the list of cells to be extended, and the control area of each cell and its relative child cell, based on the list of cells to be extended and the design state information, includes: traversing the cells in the list of cells to be extended, and determining the parent-child cell hierarchy of each cell by combining the coordinate relationship between the parent cell configuration information and the position information in the design state information; based on multiple parent-child cell hierarchy relationships, traversing the top-level cells where the parent cell is empty, if there are no child cells, setting the control area of the cell itself; if there are child cells, recursively summarizing the control areas of all child cells and their sub-child cells to determine the control area of each cell and its relative child cell.
[0081] In this embodiment, the parent-child cell hierarchical relationship is the hierarchical control logic between cells. Based on the parent cell configuration information and position coordinates, the control and managed relationships between the parent cell and its direct children and the children of the children are clearly defined, which is the core basis for the linkage and extension of parent and child cells. The control area is the coverage boundary of the parent cell over its managed children, that is, the range of rows / columns that need to be copied synchronously when the parent cell is extended. When there are no children, it is the cell itself; when there are children, it is determined by recursively summarizing the coverage areas of all children and their sub-child cells. The top-level cell is the cell where the parent cell is empty, and it is the starting node for calculating the control area. Its jurisdiction covers the table area corresponding to all direct and indirect children. Recursive summarization is the core algorithm for calculating the control area. Starting from the top-level cell, it traverses its direct children and the children of the children layer by layer, accumulating the coverage areas of all managed cells, and finally determining the complete control boundary of the parent cell.
[0082] Specifically, in the parent-child cell hierarchy determination stage, the list of cells to be extended is first traversed, and the cells are categorized based on parent cell configuration information and position coordinates: For cells explicitly set to NONE, the association process is skipped to avoid invalid calculations. For cells with default configurations, it is determined whether they are in the first row / column of the original report template. If so, no parent cell is associated; otherwise, the first expandable cell is searched to the left / upper as the parent cell, ensuring the rationality of the default rules. For cells with explicitly specified parent cells, the target cell is directly matched according to the configuration, establishing a two-way association (the parent cell records the child cell identifier, and the child cell records the parent cell identifier), ensuring accurate association. This avoids the pain point of not being able to identify parent-child relationships within row headers and clarifies the hierarchical logic of all cells.
[0083] In the process of determining the control area, top-level cells with empty parent cells are first selected. Then, the control area is calculated based on whether child cells exist: For top-level cells without child cells, the control area is set to itself, ensuring clear extension boundaries for independent cells. For top-level cells with child cells, a recursive aggregation algorithm is used to traverse all direct child cells and child cells of child cells, accumulating the row / column range covered, and finally determining the complete control boundary of the parent cell. For example, if top-level cell C5 governs D4, D5, E4, and E5, its control area after recursive aggregation is from C5 to E5, ensuring that all governed child cells can be accurately copied during extension, achieving linked extension between parent and child cells.
[0084] In some embodiments of this application, constructing an extended grid model containing cell extension states based on the parent-child grid hierarchical relationship and the control area range includes: structurally integrating the parent-child grid hierarchical relationship, control area range, and cell extension state of each cell; recording the position information of each cell after expansion to form an extended grid model containing information related to the complete extension of the cell.
[0085] In this embodiment, the extended grid model is a structured data model that records the real-time state of a cell after it has been expanded. It integrates the parent-child grid hierarchy, the controlled area, and the expanded position information, serving as the core carrier connecting design-state rules and extended execution. Structured integration involves organizing and storing scattered parent-child grid relationships, controlled area ranges, and extended status information in a unified data format, forming a standardized data structure that facilitates quick querying and retrieval during subsequent expansion processes. The extended status is the cell's real-time extended attribute, including whether it has been expanded, the number of expansions, and its current expanded position. This information is used to mark the cell's expansion progress, preventing duplicate or missed expansions. The expanded position information is the cell's latest row / column coordinates on the report page after being expanded and copied, distinct from its original design-state position, ensuring accurate cell positioning during subsequent rendering.
[0086] First, the parent-child cell hierarchy, controlled area, and extension status of each cell are structurally integrated. This embodiment binds these three types of information through a model. For example, the model for cell A1 simultaneously stores information such as "parent cell is none," "controlled area is itself," and "not extended." When filtering for extendable cells later, the extension status in the model can be directly queried, eliminating the need to repeatedly parse design-state rules and significantly improving efficiency. Second, the position information of each expanded cell is recorded to ensure traceability during the extension process. For example, after the original cell A1 is extended and copied, the position information of the new cell is recorded as A2. Its parent-child cell hierarchy and controlled area remain consistent with the original cell. The model ensures accurate matching when maintaining parent-child relationships by associating the original identifier with the new position. For instance, copied child cells can quickly find their corresponding parent cell position through the model, avoiding breakage of the association relationship. Furthermore, the structured extended grid model enables the subsequent extended execution process to form a "model-driven" closed loop: when selecting cells to be extended, the extended status and extendable identifiers in the model are used; when calculating the copy boundary, the control area range in the model is called; when maintaining the relationship, the parent-child grid hierarchy information in the model is queried. The entire process does not rely on scattered design state data, ensuring that the extended logic is coherent and the rule execution is accurate, ultimately achieving a clear hierarchy and accurate data extension effect for complex reports.
[0087] In some embodiments of this application, the criteria for selecting cells to be extended are extended identifiers; wherein, the extended identifier is an extension qualification mark determined based on the following three conditions: whether the data source mapping information in the design state information exists, whether the parent cell configuration information supports extension, and whether the length of the database query data list is greater than or equal to a preset length.
[0088] In this embodiment, the extendable identifier is a marker used to determine whether a cell is eligible for extension. It is a qualification credential derived from three core conditions in the design state information and is used to quickly filter cells that need to be extended. The data source mapping information is the association between the cell and database table fields, clarifying the source of the cell's business data query and serving as the basis for determining whether a cell has the foundation for data extension. The parent cell configuration information is the preset rules for cell parent cell association (including three types: explicitly set to NONE, default configuration, and explicitly specified parent cell). The configuration types that support extension are the default configuration (not the first row / column) and explicitly specified parent cell. The database query data list is a set of business data (such as "Region 1, Region 2, Region 3") obtained from the database based on the data source mapping information, and is the data source for cell extension. The preset length is the minimum data volume threshold set during the report design phase to trigger extension; the default value is 2, meaning that the data condition for extension is met only when the data list length is greater than or equal to 2.
[0089] First, the system checks if the data source mapping information exists. If the cell lacks data source mapping information, business data cannot be retrieved from the database, and therefore lacks the basis for extension, resulting in a direct determination of "no extension flag." If the information exists, the system proceeds to the next level of verification. Second, the system checks if the parent cell configuration information supports extension. That is, if the parent cell configuration is explicitly set to NONE, or is the default configuration and is in the first row / column, the cell has no parent cell association or does not need to be associated with a parent cell, lacking the logical basis for linked extension, and is determined to have no extension flag. If it is the default configuration (not in the first row / column) or an explicitly specified parent cell, the hierarchical association condition is met, and the system proceeds to the final verification.
[0090] Finally, the database query data list length is checked to see if it is greater than or equal to the preset length. If the data list length is less than 2 (e.g., containing only "Region 1"), all data can be displayed without expansion, and it is determined to have no expansion flag. If the length is greater than or equal to 2 (e.g., containing "Region 1, Region 2, Region 3"), the quantitative conditions for data expansion are met, and it is ultimately determined to have an expandable flag. Through these three layers of verification—data-based, logical-based, and quantitative-based—the core conditions required for expansion are fully covered, ensuring that the selected cells are all target objects with expandable data and logically expandable data, laying a precise foundation for subsequent expansion execution.
[0091] In some embodiments of this application, based on the extended grid model, cells that need to be extended are selected and added to a queue. Determining the extended table model includes: selecting cells with extendable identifiers in a row-first, top-to-bottom, and column-first, left-to-right order and adding them to the queue; sequentially retrieving cells from the queue, prioritizing the expansion of parent cells if they exist; calculating the copy boundary based on the coordinates corresponding to the size and location information of the controlled area; copying the entire row or column; assembling to generate an extended row and column model; based on the original parent-child cell hierarchical association rules in the design state information, matching the copied cell identifier with the original cell identifier, maintaining the parent-child cell hierarchical association relationship of the copied cells by combining the two-way binding of parent and child cells; identifying the merging rules based on the merging information in the design state information and assigning merging marks to the cells that need to be merged; and summarizing to generate an extended table model.
[0092] In this embodiment, firstly, cells with the expandable label are filtered and added to the queue in the order of row priority from top to bottom and column priority from left to right. This order conforms to the reading habits of basic reports and the display logic of business data, ensuring that upper-level cells are expanded first and cells at the same level are expanded in the order of left to right, avoiding the logical confusion of "child cells expanding before parent cells". Secondly, cells in the queue are retrieved one by one for expansion: if a cell has a parent cell, the parent cell is expanded first to ensure that the jurisdiction of the parent cell is determined first, and the expansion status of the parent cell can be accurately matched when the child cell is copied. Then, the copy boundary is calculated based on the size of the controlled area and the position coordinates. For example, if the parent cell's controlled area is 3 rows and 2 columns, the copy is performed on this area as a whole to avoid the copy boundary from exceeding the parent cell's jurisdiction and to ensure that the coverage of the parent and child cells is consistent. Then, the entire row or column is copied, and the expanded row and column model is assembled to record the copy status of all cells in that row / column. Next, the parent-child cell hierarchy of the copied cells is maintained: by mapping the copied cell identifier to the original cell identifier, the original parent-child cell rules in the design state information are matched. For example, if the original cell B1's parent cell is A1, the copied cell B2 will automatically be associated with the copied cell A2. Simultaneously, through two-way binding between parent and child cells, the parent cell records the child cell identifier, and the child cell records the parent cell identifier, ensuring that the hierarchy remains unbroken. Finally, based on the merging information in the design state information, merging rules are identified, and merging markers are assigned to the copied cells that need to be merged. For example, if the original cell A1 is merged downwards by a size of 2, the copied cells A2 and A3 are also simultaneously assigned this merging marker. Finally, all extended row and column models are summarized to generate an extended table model containing complete extended information, hierarchy relationships, and merging rules, providing unified data support for the rendering process.
[0093] In some embodiments of this application, copying an entire row or column includes: querying a database based on the data source mapping information in the design state information to obtain the data list corresponding to the cell; assigning the first data in the data list to the original cell, and traversing from the second data in the data list; calculating the start and end positions of the copy based on the size of the controlled area and the position coordinates of the original cell, copying the entire row or column according to the start and end positions, and filling the currently traversed data into the copied cell; if the copied cell has an extensible identifier and is a sub-cell of the currently expanded cell, then adding the copied cell to the queue.
[0094] In this embodiment, the accuracy of data filling, the accuracy of replication boundaries, and the extensibility of hierarchical linkage are achieved through a standardized process of data acquisition, replication range calculation, and dynamic queue update.
[0095] Based on the data source mapping information in the design state information, the database is queried to obtain the data list corresponding to the cell. The first data in the data list is assigned to the original cell, and the process starts from the second data. Taking the size of the controlled area as a whole and the position coordinates of the original cell as a whole, the start and end positions of the copy are calculated. The entire row or column is copied according to the start and end positions, and the data currently being traversed is filled into the copied cell. If the copied cell has an extensible identifier and is a child cell of the currently expanded cell, the copied cell is added to the queue. This continuous process ensures that the data of the original cell and the copied cell correspond one-to-one, the copy operation does not exceed the control area of the parent cell, and realizes the linkage effect of the parent cell extension driving the child cell extension, supporting the complete generation of complex hierarchical reports.
[0096] The progressive expansion process of the cross-master and child tables, with "Regional Name - Province Abbreviation - Year - Revenue Amount" as the core hierarchy, presents the complete process of the report from the initial template to multi-level expansion through four stages:
[0097] Phase one is the basic layout of the report, that is, column A (row header) contains "region name" and "province abbreviation" (forming a parent-child cell relationship), and column B (column header) contains "year" and "income amount", forming the initial structure of "row header-column header-data cell".
[0098] Phase Two: Copy the row header structure of the initial template downwards along the red arrow. Add a new group "Regional Name - Province Abbreviation" in column A, and simultaneously copy "Year - Revenue Amount" in column B to achieve the first vertical extension of the row header (parent and child cells) and initially expand the row dimensions of the report.
[0099] Phase 3: Building on Phase 2, copy the column header structure to the right along the red arrow and add column C, "Annual - Revenue Amount," to achieve horizontal extension of the column header and expand the column dimensions of the report. At this point, the report has the foundation for both row and column extension.
[0100] Phase 4: Copy the row header structure further down along the red arrow. Add a "Province Abbreviation" row to column A. At the same time, copy the corresponding "Income Amount" data cells to columns B and C. This will enable the "Province Abbreviation" (child cell) to extend in conjunction with the "Regional Name" (parent cell), ultimately forming a complete cross-parent-child table containing multiple rows (multiple sets of parent and child cells) and multiple columns (multiple sets of years).
[0101] like Figure 4 As shown, the methods for generating report pages also include:
[0102] Step 202: Traverse the cells;
[0103] Step 204: Determine if a parent cell exists. If yes, proceed to step 202; otherwise, proceed to step 206.
[0104] Step 206: Locate the current cell;
[0105] Step 208: Determine if the current cell contains a sub-cell. If yes, proceed to step 210; otherwise, proceed to step 216.
[0106] Step 210: Add the sub-cell to the governing cells and traverse the sub-cells;
[0107] Step 212: Add the governing cell of the sub-cell to the governing cell;
[0108] Step 214: Calculate the final jurisdiction of the cell based on the jurisdiction of the sub-cell;
[0109] Step 216: Set the jurisdiction to the default size and the starting position to 0.
[0110] like Figure 5 As shown, the methods for generating report pages also include:
[0111] Step 302: Obtain the list of data sources corresponding to the cells (e.g., Region 1, Region 2, Region 3).
[0112] Step 304: Set Region 1 to the cell;
[0113] Step 306: Start traversing the data from region 2;
[0114] Step 308: Obtain the jurisdiction of the cell;
[0115] Step 310: Copy the entire row or column based on the cell's location and scope;
[0116] Step 312: In the newly copied row (column), set the traversed data into the new cell;
[0117] Step 314: Based on the cell's scope, retrieve data from the previous row (column) and assign values accordingly;
[0118] Step 316: Determine if there are any cells that need to be extended in the newly copied row (column). If yes, proceed to step 318; otherwise, end the process.
[0119] Step 318: Add to queue, then proceed to step 302.
[0120] like Figure 6 As shown, the methods for generating report pages also include:
[0121] Step 402: Collect expandable cells and add them to the queue;
[0122] Step 404: Determine if the queue is empty. If yes, end the process; otherwise, proceed to step 406.
[0123] Step 406: Retrieve the cell;
[0124] Step 408: Check execution time;
[0125] Step 410: Determine if the cell has been expanded. If yes, proceed to step 414; otherwise, proceed to step 412.
[0126] Step 412: Determine if the parent cell has been expanded. If yes, proceed to step 413; otherwise, proceed to step 414.
[0127] Step 413: Expand;
[0128] Step 414: If the parent cell has not expanded, push the parent cell and the current cell into the cell;
[0129] Step 415: Continue the loop, then jump to step 404.
[0130] like Figure 7 As shown in the figure, this application embodiment provides a report page generation device 500, including a first acquisition module 502, a first determination module 504, a second determination module 506, a third determination module 508, and a first rendering module 510. The first acquisition module 502 is used to acquire the list of cells to be extended and the preset design state information of the initial report page; the first determination module 504 is used to determine the parent-child cell hierarchical relationship of each cell in the list of cells to be extended, as well as the control area range of the cell and its relative child cell, based on the list of cells to be extended and the design state information; the second determination module 506 is used to construct an extended grid model containing the cell extension state according to the parent-child cell hierarchical relationship and the control area range; the third determination module 508 is used to filter the cells to be extended and add them to the queue according to the extended grid model to determine the extended table model; the first rendering module 510 is used to render the target report page according to the extended table model and the preset page rendering rules.
[0131] In this application, the report generation device 500 constructs a complete technical closed loop of "data input - relationship determination - model construction - extended execution - rendering output" through the modular collaborative operation of the first acquisition module 502, the first determination module 504, the second determination module 506, the third determination module 508, and the first rendering module 510. The core technical effects are reflected in three aspects: First, it breaks through the limitations of the "row header - column header - intersection" design, and efficiently supports the report generation needs of complex business scenarios such as cross-parent and child tables and parent-child cross-tables by accurately determining the hierarchical relationship between parent and child cells and the scope of the control area. Second, it relies on standardized model construction and extension processes to ensure accurate and error-free extension of parent and child cells, and the merging rules are highly consistent with the design expectations, making the report extension logic more self-consistent and the display effect more standardized. Third, it reduces invalid calculations through modular division of labor. The structured model-driven extension process reduces the time consumption of frequent cell insertion. Combined with optimization algorithms such as Z-shaped filtering queue and recursive summarization, it significantly improves the generation efficiency of complex reports and shortens the execution cycle.
[0132] like Figure 8 As shown, an embodiment of this application provides a report page generation apparatus 600, including a processor 602 and a memory 604. The memory 604 stores programs or instructions. When the processor 602 executes the programs or instructions in the memory 604, it implements the steps of the report page generation method as described in any of the above embodiments. Therefore, the report page generation apparatus 600 possesses all the beneficial effects of the report page generation method as described in any of the above embodiments.
[0133] Embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the report page generation method as described in any of the above embodiments. Therefore, the readable storage medium possesses all the beneficial effects of the report page generation method as described in any of the above embodiments.
[0134] In the claims, description, and accompanying drawings of this invention, the term "plural" refers to two or more. Unless otherwise explicitly defined, the terms "upper," "lower," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and simplifying the descriptive process, and are not intended to indicate or imply that the device or element referred to must have the described specific orientation, or be constructed and operated in a specific orientation. Therefore, these descriptions should not be construed as limiting the invention. The terms "connected," "installed," "fixed," etc., should be interpreted broadly. For example, "connected" can be a fixed connection between multiple objects, a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects or an indirect connection between multiple objects through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in this invention can be understood based on the specific circumstances described above.
[0135] In the claims, description, and accompanying drawings of this invention, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the invention. In the claims, description, and accompanying drawings of this invention, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0136] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating a report page, characterized in that, include: Retrieve the list of cells to be expanded and the preset design state information from the initial report page; Based on the list of cells to be extended and the design state information, determine the parent-child cell hierarchy of each cell in the list of cells to be extended, as well as the control area of the cell and its relative child cell; Based on the parent-child grid hierarchy and the control area, an extended grid model including the cell extension state is constructed; Based on the extended grid model, the cells that need to be extended are selected and added to the queue to determine the extended table model; The target report page is rendered based on the extended table model and the preset page rendering rules.
2. The method for generating report pages according to claim 1, characterized in that, The design state information includes at least cell merging information, position information, parent cell configuration information, and data source mapping information; Among them, the merging information is the downward merging size and the right merging size of the cell, the position information is the row or column coordinate of the cell in the original report template, the parent cell configuration information includes three types: explicitly set to NONE, default configuration, and explicitly specify parent cell, and the data source mapping information is the database table field association information corresponding to the cell.
3. The method for generating report pages according to claim 1, characterized in that, The determination of the parent-child cell hierarchy relationship of each cell in the list of cells to be extended, and the control area range of the cell and its relative child cell, based on the list of cells to be extended and the design state information, includes: Traverse the cells in the list of cells to be extended, and determine the parent-child cell hierarchy relationship of each cell by combining the coordinate relationship between the parent cell configuration information and the position information in the design state information; Based on the parent-child cell hierarchical relationships, the top-level cells with empty parent cells are traversed. If there are no child cells, the control area is set to the cell itself. If there are child cells, the control areas of all child cells and their sub-child cells are recursively summarized to determine the control area of each cell and its relative child cells.
4. The method for generating report pages according to claim 1, characterized in that, The step of constructing an extended grid model containing cell extension states based on the parent-child grid hierarchical relationship and the control area range includes: The parent-child cell hierarchy, controlled area range, and cell extension status of each cell are structurally integrated; Record the position information of each cell after it is expanded to form an extended grid model containing information related to the complete expansion of the cells.
5. The method for generating report pages according to claim 1, characterized in that, The criteria for selecting cells that need to be extended are the extendable indicators; The extensibility identifier is an extensibility qualification mark determined based on the following three conditions: whether the data source mapping information in the design state information exists, whether the parent grid configuration information supports extensibility, and whether the length of the database query data list is greater than or equal to the preset length.
6. The method for generating a report page according to claim 1, characterized in that, The step of selecting the cells to be extended and adding them to the queue according to the extended grid model, and determining the extended table model, includes: Filter cells with expandable labels and add them to the queue in the order of row priority from top to bottom and column priority from left to right; The cells in the queue are retrieved sequentially. If a cell has a parent cell, the parent cell is expanded first. The copy boundary is calculated based on the coordinates corresponding to the size and location information of the controlled area. The entire row or column is copied and assembled to generate an extended row and column model. Based on the original parent-child cell hierarchy association rules in the design state information, the copied cell identifier is matched with the original cell identifier. The parent-child cell hierarchy association relationship of the copied cell is maintained by combining the two-way binding between the parent and child cells. Then, based on the merging information in the design state information, the merging rules are identified and merging marks are assigned to the cells that need to be merged. Finally, the extended table model is generated.
7. The method for generating report pages according to claim 6, characterized in that, The copying of an entire row or column includes: Based on the data source mapping information in the design state information, query the database to obtain the data list corresponding to the cell; Assign the first data item in the data list to the original cell, and start iterating from the second data item in the data list; Taking the size of the controlled area as a whole, and combining the position coordinates of the original cell, calculate the start and end positions for copying. Copy the entire row or column according to the start and end positions, and fill the copied cell with the data currently being traversed. If the copied cell has an expandable identifier and is a subcell of the currently expanded cell, then the copied cell is added to the queue.
8. A report page generation device, characterized in that, include: The first acquisition module is used to acquire the list of cells to be expanded and the preset design state information of the initial report page; The first determining module is used to determine the parent-child cell hierarchy relationship of each cell in the cell list to be extended, and the control area range of the cell and its relative child cell, based on the cell list to be extended and the design state information. The second determining module is used to construct an extended grid model containing the cell extension state based on the parent-child grid hierarchical relationship and the control area range; The third determining module is used to filter the cells to be extended and add them to the queue according to the extended grid model, thereby determining the extended table model; The first rendering module is used to render the target report page according to the extended table model and preset page rendering rules.
9. A report page generation device, characterized in that, include: processor; A memory storing programs or instructions, wherein the processor, when executing the programs or instructions in the memory, implements the steps of the method for generating a report page as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method for generating a report page as described in any one of claims 1 to 7.