Dynamic data rendering method, device and electronic device for Web table
By dynamically expanding the blocks of web tables, the problem of limited cell dependency expression is solved, flexible design and efficient rendering of complex reports is realized, and the needs of complex reports such as subtotal and classification description are met.
Patent Information
- Application Number
- CN202411217048.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-02
AI Technical Summary
When existing web tables render complex reports, cell dependency expression is limited, so complex reports cannot be flexibly constructed, especially when subtotal or classification description is required.
By obtaining the configuration data of the web table, analyzing the block configuration data to generate a tree structure, dynamically expanding the blocks according to the preset block expansion order, controlling the dependencies between blocks, and supporting flexible expression and grouping of multi-layer data. Meet the rendering needs of complex reports.
It improves the flexibility and ease of use of complex report design, improves generation efficiency, and can flexibly express different dependencies and meets the needs of complex reports such as subtotals and classification descriptions.
Smart Images

Figure CN118761393B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device and electronic equipment for rendering dynamic data of a Web table. Background Art
[0002] Currently, rendering complex reports in Web tables is configured through table cells, and a tree dependency relationship between cells is generated during configuration. When calculating the tree dependency relationship based on cell configuration, it is left dependency or top dependency. If there are both left and top cells, only one can be discarded. You can use the highest level dependency. For example, if the top cell has a parent and the left cell has no parent, the dependency relationship of the current cell corresponds to the top cell. There are also solutions that use the left side as the main and the top side as the auxiliary or are manually set, which are difficult to understand from a user's perspective. In addition, the dependent data between cells must be adjacent, which cannot be supported when some complex reports require blank lines, subtotals, or classification descriptions. Summary of the invention
[0003] The present invention provides a method, device and electronic device for dynamic data rendering of a Web table, which are used to solve the defects of the prior art that the expression of dependency relationships is limited when configuring through cells of a table and complex reports cannot be flexibly constructed, and realize flexible expression that satisfies different dependency relationships, meets the rendering requirements of complex reports such as subtotals and classification descriptions, and improves the flexibility, usability and generation efficiency of complex report design.
[0004] The present invention provides a method for rendering dynamic data of a Web table, comprising the following steps: acquiring configuration data of the Web table; wherein the configuration data comprises block configuration data of at least one block, and the block configuration data comprises location information, expansion direction, expansion mode, data set and configuration information of cells in the block; performing parsing according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between parent and child blocks represents the dependency relationship between blocks; dynamically expanding blocks corresponding to each of the tree structures based on the block configuration data and a preset block expansion sequence to obtain data to be filled in cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks are updated in position following the expansion of the blocks; and rendering the data to be filled in cells corresponding to each block for display.
[0005] According to a dynamic data rendering method for a Web table provided by the present invention, the pre-set block expansion order includes: according to the block configuration data, if the upper root node block among the root node blocks of different tree structures contains a block that expands downward, then the block in the tree structure corresponding to the upper root node block is preferentially expanded; if the left root node block among the root node blocks of different tree structures contains a block that expands rightward, then the block in the tree structure corresponding to the left root node block is preferentially expanded.
[0006] According to a method for rendering dynamic data of a Web table provided by the present invention, the blocks corresponding to each tree structure are dynamically expanded, including: in the order of the node levels in the tree structure from low to high, instantiated data is cyclically obtained according to the expansion mode of the parent node block and the corresponding data set, and the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and the expansion mode of the parent node block for each instantiated data; wherein, if the parent node block includes child node blocks, each time the instantiated data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion mode, expansion direction and corresponding data set of the child node block; if the upper block in the same level block contains a block that expands downward, the upper block is preferentially expanded; if the left block in the same level block contains a block that expands rightward, the left block is preferentially expanded.
[0007] According to a dynamic data rendering method for a Web table provided by the present invention, the child node block is dynamically expanded according to the expansion mode, expansion direction and corresponding data set of the child node block, including: if the child node block and the parent node block use the same data set, the child node block inherits the instantiation data of the parent node block and obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion mode of the child node block for each instantiation data; if the child node block and the parent node block use different data sets, the child node block obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion mode of the child node block for each instantiation data.
[0008] According to a dynamic data rendering method of a Web table provided by the present invention, the configuration data of the Web table also includes configuration information of cells independent of blocks; the method also includes: in the dynamic expansion of the block, if there are cells independent of the block in the expansion direction of the block, then the cell updates its position following the expansion of the block.
[0009] According to a dynamic data rendering method for a Web table provided by the present invention, the method also includes: after the blocks located above and to the left of the cell independent of the block are expanded, according to the configuration information of the cell independent of the block, obtaining the data to be filled in the cell, and rendering the data to be filled in the cell independent of the block for display.
[0010] According to a dynamic data rendering method for a Web table provided by the present invention, the expansion direction includes downward expansion or rightward expansion; the expansion mode includes group expansion or list expansion, and when the expansion mode is group expansion, the block configuration data also includes a group field.
[0011] According to a dynamic data rendering method for a Web table provided by the present invention, the configuration information of the cell is a constant, a reference field or a calculation formula; wherein, for the reference field, when the extension method is a group extension, the configuration information of the cell also includes a display method of the reference field.
[0012] The present invention also provides a dynamic data rendering device for a Web table, comprising the following modules: an acquisition module, used to acquire configuration data of the Web table; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block; a parsing module, used to parse according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between parent and child blocks represents the dependency relationship between blocks; an expansion module, used to dynamically expand the blocks corresponding to each of the tree structures based on the block configuration data and a preset block expansion sequence to obtain data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; and a rendering module, used to render the data to be filled into the cells corresponding to each block for display.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for dynamic data rendering of a Web table as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for dynamic data rendering of a Web table as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for dynamic data rendering of a Web table.
[0016] The method, device and electronic device for rendering dynamic data of a Web table provided by the present invention obtain configuration data of the Web table, wherein the configuration data includes block configuration data of at least one block, wherein the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block, and parses the block configuration data to obtain at least one tree structure, wherein the tree structure corresponds to an independent block or a nested block, wherein the nested relationship between parent and child blocks in the tree structure corresponding to the nested block represents the dependency relationship between the blocks, and dynamically expands the blocks corresponding to each tree structure based on the block configuration data and a preset block expansion sequence to obtain data to be filled in the cells of the expanded blocks, and the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks, and render the data to be filled in the cells corresponding to each block for display, and the dependency relationship of multi-layer data is controlled by nesting between blocks, so as to meet the flexible expression of different dependency relationships, and the dynamic data is grouped by block expansion and inheritance to meet the rendering requirements of complex reports such as subtotals and classification descriptions, thereby improving the flexibility, usability and generation efficiency of complex report design. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is one of the flow charts of the dynamic data rendering method of the Web table provided by the present invention.
[0019] Figure 2It is a schematic diagram of part of the configuration data of a Web table in the dynamic data rendering method of the Web table provided by the present invention.
[0020] Figure 3 is based on Figure 2 Schematic diagram of dynamic data rendering results of the configuration data shown.
[0021] Figure 4 This is the second flow chart of the dynamic data rendering method of the Web table provided by the present invention.
[0022] Figure 5 It is a structural schematic diagram of a dynamic data rendering device for a Web table provided by the present invention.
[0023] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Figure 1 This is one of the flow charts of the method for dynamic data rendering of a Web table provided by the present invention. Figure 1 As shown, the method includes:
[0026] Step S1, obtaining configuration data of the Web form; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block.
[0027] Before obtaining the configuration data of the Web table, the configuration data of the Web table needs to be pre-configured. The configuration data includes the block configuration data of at least one block, and the block configuration data includes the location information, expansion direction, expansion method, data set, and configuration information of cells in the block. Dynamic data refers to data that is queried in real time based on a data set.
[0028] When configuring the configuration data of the Web table, you can drag the mouse to select the area to generate the block in the Web table, and then click the "Generate Block" button to generate the block. The location information of the block is the area selected by dragging the mouse. The block is the extension range of the selected dynamic data. The extension direction and extension method can be set for the block. When the extension method is grouping, select the data set and set the grouping field. The extension direction, extension method and data set of the block can be configured through the configuration items. Among them, the extension direction can be set to downward extension or right extension, and the extension method can be set to group extension or list extension. The data set of the block can be configured, and data can be obtained in advance according to the configured data set for temporary storage. For the cells in the block that need to display data, configure the cells. The configuration of cells can support constants, reference fields and formulas. Cells include original cells and merged cells in the Web table.
[0029] Get the configuration data of the web form based on the pre-configured results.
[0030] Figure 2 Schematic diagram of part of the configuration data of the Web table in the dynamic data rendering method of the Web table provided by the present invention. Because some configuration data is configured in the background, Figure 2 Not shown in Figure 2 As shown, the web form is used for employee statistics. The configured blocks include A3:H4 and C3:H3. The two blocks have a nested relationship, A3:H4 is the parent node block, and C3:H3 is the child node block. Among them, the expansion direction of the parent node block A3:H4 is set to downward expansion, and the expansion method is set to group expansion. The expansion direction of the child node block C3:H3 is set to downward expansion, and the expansion method is set to list expansion. For group expansion, block expansion is performed based on the results of group statistics. For list expansion, the data of the reference field set in the cell can be directly obtained for display.
[0031] Figure 2 In the example, the merged cells C4, D4, and E4 are set to display the constant "Subtotal", and the cells F4, G4, and H4 on the right are set to reference fields and statistical methods, or calculation formulas. Therefore, the statistical results can be displayed conveniently.
[0032] Step S2: parsing the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nesting relationship between the parent and child blocks represents the dependency relationship between the blocks.
[0033] Parse the block configuration data to obtain at least one tree structure. When parsing the tree structure, parse based on the location information of the block. Parse the configuration data of the Web table to obtain one or more tree structures. Each tree structure corresponds to an independent block or a nested block. In the tree structure corresponding to the nested block, the nested relationship between the parent and child blocks represents the dependency relationship between the blocks. If there is no dependency between the blocks, they are blocks in different trees.
[0034] Blocks are allowed to be nested, group blocks (blocks extended by grouping) are allowed to nest sub-blocks, list blocks (blocks extended by list) are not allowed to nest sub-blocks; blocks only support nesting of containment relationships, no crossing or duplication is allowed, and blocks are allowed to be nested at multiple levels. If the tree structure contains only one independent block, it only includes one root node block.
[0035] Step S3, dynamically expand the blocks corresponding to each of the tree structures based on the block configuration data and the preset block expansion order to obtain the data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks.
[0036] Based on the block configuration data and the pre-set block expansion order, the blocks corresponding to each tree structure are dynamically expanded to obtain the data to be filled in the cells of the expanded blocks. The dynamic expansion of blocks means looping to obtain instantiated data according to the data set, and expanding the instantiated data each time according to the number of rows and columns configured in the block. When dynamically expanding the blocks corresponding to each tree structure, it is based on the pre-configured block expansion order. During the block expansion process, the blocks located in the expansion direction of the block currently in dynamic expansion will update their positions following the expansion of the block.
[0037] Step S4: Render the data to be filled into the cells corresponding to each block for display.
[0038] The instantiation of the dynamic expansion process actually obtains the data to be filled in each cell after the block is expanded. However, the data to be filled has not been rendered to the Web table. You can call a third-party plug-in to render the data to be filled in each cell to the corresponding cell of each block for display.
[0039] The method for rendering dynamic data of a Web table provided by the present invention obtains configuration data of the Web table, wherein the configuration data includes block configuration data of at least one block, the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block, and performs parsing according to the block configuration data to obtain at least one tree structure, wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between the parent and child blocks represents the dependency relationship between the blocks, and dynamically expands the blocks corresponding to each tree structure based on the block configuration data and a preset block expansion sequence to obtain the data to be filled in the cells of the expanded blocks, and the blocks located in the expansion direction of the dynamically expanded blocks are updated with the expansion of the blocks, and the data to be filled is rendered to the cells corresponding to each block for display, and the dependency relationship of multi-layer data is controlled by nesting between blocks, so as to meet the flexible expression of different dependency relationships, and the dynamic data is grouped by block expansion and inheritance to meet the rendering requirements of complex reports such as subtotals and classification descriptions, thereby improving the flexibility, usability and generation efficiency of complex report design.
[0040] According to a dynamic data rendering method for a Web table provided by the present invention, the pre-set block expansion order includes: according to the block configuration data, if the upper root node block among the root node blocks of different tree structures contains a block that expands downward, then the block in the tree structure corresponding to the upper root node block is preferentially expanded; if the left root node block among the root node blocks of different tree structures contains a block that expands rightward, then the block in the tree structure corresponding to the left root node block is preferentially expanded.
[0041] Since the expansion direction of the block is downward expansion or rightward expansion, therefore, when setting the expansion order of the block, according to the block configuration data, if the upper root node block in the root node blocks of different tree structures contains a block that expands downward, the block in the tree structure corresponding to the upper root node block is preferentially expanded. In this way, after the block in the tree structure corresponding to the upper root node block is expanded, the updated position of the block in the tree structure corresponding to the lower root node block can be obtained, and the block in the tree structure corresponding to the lower root node block is expanded based on the updated position of the block. If the left root node block in the root node blocks of different tree structures contains a block that expands rightward, the block in the tree structure corresponding to the left root node block is preferentially expanded. In this way, after the block in the tree structure corresponding to the left root node block is expanded, the updated position of the block in the tree structure corresponding to the right root node block can be obtained, and the block in the tree structure corresponding to the right root node block is expanded based on the updated position of the block. Among them, the existence of a left-right position relationship between two blocks means that there are cells belonging to the same row between the two blocks, and the existence of an up-down position relationship between two blocks means that there are cells belonging to the same column between the two blocks.
[0042] For simplicity, the order of block expansion can be set to start from the root node block closest to the Web table A1 cell. After the blocks in the tree structure corresponding to the root node block are expanded, the root node block closest to the root node block is obtained from other root node blocks, and the blocks in the tree structure corresponding to the root node block are expanded. If there are both right and bottom root node blocks closest to the root node block, the blocks in the tree structure corresponding to the bottom root node block can be expanded first, and then the blocks in the tree structure corresponding to the right root node block can be expanded.
[0043] The dynamic data rendering method of the Web table provided by the present invention, according to the block configuration data, if the upper root node block among the root node blocks of different tree structures contains a block that expands downward, the block in the tree structure corresponding to the upper root node block is preferentially expanded; if the left root node block among the root node blocks of different tree structures contains a block that expands rightward, the block in the tree structure corresponding to the left root node block is preferentially expanded, thereby avoiding data being overwritten when the block is expanded.
[0044] According to a method for rendering dynamic data of a Web table provided by the present invention, the blocks corresponding to each tree structure are dynamically expanded, including: in the order of the node levels in the tree structure from low to high, instantiated data is cyclically obtained according to the expansion mode of the parent node block and the corresponding data set, and the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and the expansion mode of the parent node block for each instantiated data; wherein, if the parent node block includes child node blocks, each time the instantiated data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion mode, expansion direction and corresponding data set of the child node block; if the upper block in the same level block contains a block that expands downward, the upper block is preferentially expanded; if the left block in the same level block contains a block that expands rightward, the left block is preferentially expanded.
[0045] When dynamically expanding the blocks corresponding to each tree structure, for the dynamic expansion of each block corresponding to the tree structure, the instantiated data is obtained according to the expansion method of the parent node block and the corresponding data set in the order of the node level in the tree structure from low to high, and the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and expansion method of the parent node block for each instantiated data. Among them, the node level of the parent node block is lower than the node level of the child node block.
[0046] When a block is expanded, instantiated data is obtained based on the configuration information and data sets of the cells in the block. Figure 2 As shown, in the order of the node levels in the tree structure from low to high, the instantiated data is obtained according to the expansion method of the parent node block and the corresponding data set, that is, the parent node block A3:H4 is expanded first. The parent node block A3:H4 is used to count the number of people in the department. According to the data set corresponding to the parent node block, an instantiated data is obtained each time the number of people in a department is obtained. Each time an instantiated data is obtained, the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and expansion method of the parent node block.
[0047] If the parent node block includes child node blocks, then each time a piece of instantiated data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion method, expansion direction and corresponding data set of the child node block. Figure 2As shown, the parent node block A3:H4 includes the child node block C3:H3. Then, each time a piece of instantiated data of the parent node block A3:H4 is obtained, that is, each time the result of the number of people in a department is obtained, the child node block C3:H3 is dynamically expanded for the department, and the surname, first name, full name, salary, subsidy and salary information of the personnel included in the department are displayed through a list. Each time the above data of a person is obtained, an instantiated data of a child node block is obtained, and the data of all personnel in the department need to be obtained through a loop. That is, after the parent node block obtains each piece of instantiated data for expansion, it is necessary to complete the acquisition of all instantiated data of the child node blocks contained in the parent node block and the expansion of the child node blocks. Blocks can be nested at multiple levels, and the dynamic expansion process of each pair of parent-child nodes needs to follow the above rules. The number of rows and columns expanded by the child node block is counted into the number of rows and columns expanded by the parent node block.
[0048] The cells in a block are part of the block and expand with the block, such as Figure 2 As shown, the cell where "Subtotal" is located and the cells F4, G4, and H4 to the right of "Subtotal" will expand with each instantiation of the parent node block A3:H4, that is, each time the data of a department is obtained, the subtotal statistical results for the department will be displayed. Since the child node block C3:H3 is displayed above the "Subtotal" cell and the cells F4, G4, and H4 to the right, the subtotal statistical results of this part will be displayed after the child node block C3:H3 is expanded.
[0049] In addition, a parent node block may contain multiple child node blocks. If a parent node block contains multiple child node blocks, the node levels of the multiple child node blocks are the same, that is, the same-level blocks. Since each expansion of a piece of instantiated data of a parent node block requires the expansion of all instantiated data of each child node block it contains, the expansion of each child node block of the same level needs to be carried out in accordance with the set dynamic expansion order. When the same-level blocks are dynamically expanded, it is necessary to satisfy that if the upper block in the same-level block contains a block that expands downward, the upper block is expanded first; if the left block in the same-level block contains a block that expands to the right, the left block is expanded first.
[0050] The dynamic data rendering method of the Web table provided by the present invention obtains instantiated data cyclically according to the expansion mode of the parent node block and the corresponding data set in the order of the node levels from low to high in the tree structure, and dynamically expands the parent node block according to the number of rows and columns occupied by the parent node block, the expansion direction and the expansion mode of the parent node block for each instantiated data; if the parent node block includes a child node block, each time an instantiated data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion mode, expansion direction and the corresponding data set of the child node block; if the upper block in the same level block contains a block that expands downward, the upper block is preferentially expanded; if the left block in the same level block contains a block that expands rightward, the left block is preferentially expanded, thereby realizing the orderly dynamic expansion of the blocks corresponding to the tree structure and ensuring the accuracy and reliability of information display.
[0051] According to a dynamic data rendering method for a Web table provided by the present invention, the child node block is dynamically expanded according to the expansion mode, expansion direction and corresponding data set of the child node block, including: if the child node block and the parent node block use the same data set, the child node block inherits the instantiation data of the parent node block and obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion mode of the child node block for each instantiation data; if the child node block and the parent node block use different data sets, the child node block obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion mode of the child node block for each instantiation data.
[0052] When dynamically expanding a child node block according to the expansion method, expansion direction and corresponding data set of the child node block, if the child node block and the parent node block use the same data set, the child node block inherits the instantiation data of the parent node block and loops to obtain the instantiation data of the child node block according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion method of the child node block for each instantiation data. Figure 2As shown, the child node block C3:H3 is used to display the specific data of the department personnel. Therefore, the child node block C3:H3 and the parent node block A3:H4 need to be set to the same data source, and there is an inheritance relationship between the parent and child blocks. After obtaining an instantiation data of the parent node block A3:H4, such as the number of personnel in Department 1, the child node block C3:H3 will inherit the result of Department 1, and loop to obtain the instantiation data of the child node block according to the block configuration data of the child node block C3:H3, that is, loop to obtain the name, salary and other entry data of each person in Department 1.
[0053] However, the parent and child blocks are not required to use the same data source. If the parent and child blocks use different data sources, the child node block must be expanded after the parent node block obtains an instantiation data and performs block expansion. However, since there is no data inheritance relationship between the parent and child blocks, when the child block is dynamically expanded, it only needs to loop to obtain the instantiation data of the child node block according to the block configuration data of the child node block, and dynamically expand the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion method of the child node block for each instantiation data.
[0054] The dynamic data rendering method of the Web table provided by the present invention is as follows: if the child node block and the parent node block use the same data set, the child node block inherits the instantiation data of the parent node block and obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and the expansion method of the child node block for each instantiation data; if the child node block and the parent node block use different data sets, the child node block obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and the expansion method of the child node block for each instantiation data, thereby improving the flexibility of the parent-child block data source configuration and block expansion.
[0055] According to a dynamic data rendering method of a Web table provided by the present invention, the configuration data of the Web table also includes configuration information of cells independent of blocks; the method also includes: in the dynamic expansion of the block, if there are cells independent of the block in the expansion direction of the block, then the cell updates its position following the expansion of the block.
[0056] In addition to configuring blocks and cells within blocks, Web table configuration data can also include configuration information for cells that are independent of blocks, such as Figure 2The cells in the row where the "Total" is located only need to perform the final statistics to get one result. There is no need to expand the blocks according to the data set. Therefore, there is no need to set the blocks. You only need to configure the cells in the row where the "Total" is located.
[0057] In the dynamic expansion of a block, if there are cells independent of the block in the expansion direction of the block, the cells will update their positions following the expansion of the block. Figure 2 When the parent node block A3:H4 and the child node block C3:H3 are dynamically expanded downward, if there are cells in the row where the "Total" of the block is located in the expansion direction, the cells in the row where the "Total" is located will update their positions following the expansion of the block, that is, they will move downward following the expansion of the block.
[0058] in addition, Figure 2 The titles in the , such as the cells including department, number of people, last name, first name, full name, salary, subsidy, and salary benefits, are also cells that do not belong to any block. Since these cells are not in the expansion direction of the block, there is no need to update their positions. You only need to set the corresponding cells to constant display, which makes it easy to display the titles.
[0059] The dynamic data rendering method of the Web table provided by the present invention further includes configuration information of cells independent of blocks through the configuration data of the Web table. During the dynamic expansion of the block, if there are cells independent of the block in the expansion direction of the block, the cells update their positions following the expansion of the block, thereby improving the flexibility of the dynamic data rendering of the Web table.
[0060] According to a dynamic data rendering method for a Web table provided by the present invention, the method also includes: after the blocks located above and to the left of the cell independent of the block are expanded, according to the configuration information of the cell independent of the block, obtaining the data to be filled in the cell, and rendering the data to be filled in the cell independent of the block for display.
[0061] For cells independent of blocks, after the blocks above and to the left of the cells independent of blocks are expanded, the data to be filled in the cells independent of blocks is obtained according to the configuration information of the cells independent of blocks. The data to be filled in the cells independent of blocks may be the statistical result of the instantiated data of the blocks above or to the left. The data to be filled is rendered to the cells independent of blocks for display.
[0062] Figure 3 is based on Figure 2 Schematic diagram of dynamic data rendering results of the configuration data shown.
[0063] The dynamic data rendering method of the Web table provided by the present invention obtains the data to be filled in the cell according to the configuration information of the cell independent of the block after the blocks located above and to the left of the cell independent of the block are expanded, and renders the data to be filled in the cell independent of the block for display, thereby ensuring the orderliness and reliability of information display.
[0064] According to a dynamic data rendering method for a Web table provided by the present invention, the expansion direction includes downward expansion or rightward expansion; the expansion mode includes group expansion or list expansion, and when the expansion mode is group expansion, the block configuration data also includes a group field.
[0065] The dynamic data rendering method of the Web table provided by the present invention improves the flexibility of the dynamic data rendering of the Web table by setting the expansion direction to include downward expansion or rightward expansion; the expansion mode includes grouping expansion or list expansion, and when the expansion mode is grouping expansion, the block configuration data also includes grouping fields.
[0066] According to a dynamic data rendering method for a Web table provided by the present invention, the configuration information of the cell is a constant, a reference field or a calculation formula; wherein, for the reference field, when the extension method is a group extension, the configuration information of the cell also includes a display method of the reference field.
[0067] The calculation formula may adopt the native formula of the web table. The display method of the reference field may include counting and deduplication of the reference field.
[0068] The dynamic data rendering method of the Web table provided by the present invention improves the flexibility and simplicity of the dynamic data rendering of the Web table by setting the configuration information of the cell to a constant, a reference field or a calculation formula. For the reference field, when the expansion method is a group expansion, the configuration information of the cell also includes the display method of the reference field.
[0069] Figure 4 This is the second flow chart of the method for dynamic data rendering of a Web table provided by the present invention. Figure 4 As shown, the method includes:
[0070] Step S101: configure blocks, styles and data in a Web form to obtain configuration data of the Web form, wherein the configuration data of the Web form includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block.
[0071] Step S201: Acquire and parse the configuration data of the Web form.
[0072] Step S301: Acquire data according to the configured data set and store it temporarily.
[0073] Step S401, dynamically expand the block according to the configuration data and data set of the Web table to obtain the data to be filled. The tree structure is calculated according to the configured blocks. The blocks are allowed to be nested, and the tree structure is rendered according to the nested relationship. If the parent and child blocks use the same data set, there is an inheritance relationship between the parent and child blocks, and the child blocks inherit the parent block value for grouping; if they are different data sets, they are directly displayed according to the configuration. The tree structure that allows multiple blocks to be rendered, if there are multiple tree structures, the blocks of the tree structure will be expanded in order from top to bottom and from left to right. After obtaining all the tree structures, start instantiation from the root node block of the tree structure closest to A1. The upper left corner of the block is the block location, and the number of rows and columns from the upper left corner to the lower right corner are looped according to the dynamic data obtained in S30 according to the configuration direction, and each data is looped once. If there are child node blocks, the parent node block will start calculating the expansion of the child node block after one loop, and the number of rows and columns of the child node block expansion will be counted into the number of rows and columns of the parent node block expansion until the dynamic data loop is completed. After calculating the blocks in the tree structure corresponding to the root node block closest to A1, start calculating the blocks in the tree structure corresponding to the root node block closest to the current root node block. If there are both right and bottom root node blocks, the blocks in the tree structure corresponding to the root node block below can be calculated first, and then the blocks in the tree structure corresponding to the root node block on the right can be calculated.
[0074] In block expansion, data is filled in a polling instance manner according to the constants, reference fields, and formulas in the cell configuration. If the cell is within the block, it will be expanded along with the block. If the cell is outside the block, the position will be updated by adding the number of rows and columns of the block expansion.
[0075] Step S501: Fill the calculated data into the corresponding cells to complete the Web table data rendering.
[0076] The dynamic data rendering method of the Web table provided by the present invention renders dynamic data through blocks. Constants, reference fields and formulas can be set in the blocks. The blocks support nested generation of tree structures, and complex structure reports such as multi-source segmentation, column division, nested intersection, etc. can be configured. The dynamic data rendering method of the Web table provided by the present invention allows users to configure complex reports in Web tables more simply and conveniently. The method based on the present invention controls the dependency relationship of multi-layer data through block configuration, restricting blocks from crossing but allowing nesting; and the dynamic data is expanded by blocks, and constants, reference fields and formulas are configured for cells in the blocks, and inheritance grouping is performed by blocks, i.e., multiple cells in a range, to meet the rendering requirements of complex reports such as subtotals and classification descriptions.
[0077] The dynamic data rendering device of a Web table provided by the present invention is described below. The dynamic data rendering device of a Web table described below and the dynamic data rendering method of a Web table described above can be referred to each other.
[0078] Figure 5 Schematic diagram of the structure of the dynamic data rendering device of the Web table provided by the present invention. Figure 5 As shown, the device includes an acquisition module 10, a parsing module 20, an expansion module 30 and a rendering module 40, wherein: the acquisition module 10 is used to: acquire the configuration data of the Web table; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes the location information, expansion direction, expansion mode, data set and configuration information of cells in the block; the parsing module 20 is used to: parse according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between the parent and child blocks represents the dependency relationship between the blocks; the expansion module 30 is used to: dynamically expand the blocks corresponding to each of the tree structures based on the block configuration data and the preset block expansion sequence to obtain the data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks are updated with the expansion of the blocks; the rendering module 40 is used to: render the data to be filled into the cells corresponding to each block for display.
[0079] The dynamic data rendering device of a Web table provided by the present invention obtains configuration data of the Web table, wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block. The block configuration data is parsed to obtain at least one tree structure, wherein the tree structure corresponds to an independent block or a nested block. In the tree structure corresponding to the nested block, the nested relationship between the parent and child blocks represents the dependency relationship between the blocks. The blocks corresponding to each tree structure are dynamically expanded based on the block configuration data and a preset block expansion sequence to obtain the data to be filled in the cells of the expanded blocks. The blocks located in the expansion direction of the dynamically expanded blocks are updated with the expansion of the blocks, and the data to be filled is rendered to the cells corresponding to each block for display. The dependency relationship of multi-layer data is controlled by nesting between blocks, so that the flexible expression of different dependency relationships can be met. The dynamic data is grouped by block expansion and inheritance to meet the rendering requirements of complex reports such as subtotals and classification descriptions, thereby improving the flexibility, usability and generation efficiency of complex report design.
[0080] Figure 6An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor (processor) 610 , a communication interface (Communications Interface) 620 , a memory (memory) 630 and a communication bus 640 , wherein the processor 610 , the communication interface 620 , and the memory 630 communicate with each other through the communication bus 640 . The processor 610 can call the logic instructions in the memory 630 to execute the dynamic data rendering method of the Web table, which includes: obtaining the configuration data of the Web table; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes the location information, expansion direction, expansion mode, data set and configuration information of the cells in the block; parsing according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nesting relationship between the parent and child blocks represents the dependency relationship between the blocks; dynamically expanding the blocks corresponding to each of the tree structures based on the block configuration data and the preset block expansion order to obtain the data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; and rendering the data to be filled to the cells corresponding to each block for display.
[0081] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0082] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the dynamic data rendering method of the Web table provided by the above methods, the method comprising: obtaining configuration data of the Web table; wherein the configuration data includes block configuration data of at least one block, the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block; parsing according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nesting relationship between the parent and child blocks represents the dependency relationship between the blocks; dynamically expanding the blocks corresponding to each of the tree structures based on the block configuration data and the preset block expansion order to obtain the data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; and rendering the data to be filled in to the cells corresponding to each block for display.
[0083] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the dynamic data rendering method of the Web table provided by the above methods when executed by the processor, the method comprising: obtaining configuration data of the Web table; wherein the configuration data comprises block configuration data of at least one block, the block configuration data comprises location information, expansion direction, expansion mode, data set and configuration information of cells in the block; parsing according to the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between parent and child blocks represents the dependency relationship between blocks; dynamically expanding the blocks corresponding to each of the tree structures based on the block configuration data and a preset block expansion order to obtain data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; and rendering the data to be filled into the cells corresponding to each block for display.
[0084] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dynamic data rendering of a Web table, characterized in that: include: Acquire configuration data of the Web table; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block; Parsing the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nested relationship between the parent and child blocks represents the dependency relationship between the blocks; Dynamically expand the blocks corresponding to each of the tree structures based on the block configuration data and the preset block expansion sequence to obtain data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; Render the data to be filled into the cells corresponding to each block for display; The preset block extension sequence includes: According to the block configuration data, if the upper root node block among the root node blocks of different tree structures includes a block that is extended downward, the block in the tree structure corresponding to the upper root node block is preferentially extended; if the left root node block among the root node blocks of different tree structures includes a block that is extended rightward, the block in the tree structure corresponding to the left root node block is preferentially extended; The dynamically expanding the blocks corresponding to each of the tree structures includes: In the order of the node levels in the tree structure from low to high, the instantiated data is acquired cyclically according to the expansion mode of the parent node block and the corresponding data set, and the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and expansion mode of the parent node block for each instantiated data; Among them, if the parent node block includes a child node block, each time the instantiation data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion method, expansion direction and corresponding data set of the child node block; if the upper block among the same-level blocks contains a block that expands downward, the upper block is expanded first; if the left block among the same-level blocks contains a block that expands rightward, the left block is expanded first.
2. The method for dynamic data rendering of a Web table according to claim 1, characterized in that: The dynamically expanding the sub-node block according to the expansion mode, expansion direction and corresponding data set of the sub-node block includes: If the child node block and the parent node block use the same data set, the child node block inherits the instantiation data of the parent node block and obtains the instantiation data of the child node block in a loop according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion method of the child node block for each instantiation data; If the child node block and the parent node block use different data sets, the child node block loops to obtain the instantiation data of the child node block according to the block configuration data of the child node block, and dynamically expands the child node block according to the number of rows and columns occupied by the child node block, the expansion direction and expansion method of the child node block for each instantiation data.
3. The method for dynamic data rendering of a Web table according to claim 1, characterized in that: The configuration data of the Web form also includes configuration information of cells independent of blocks; the method also includes: In the dynamic expansion of a block, if there are cells independent of the block in the expansion direction of the block, the position of the cells is updated following the expansion of the block.
4. The method for dynamic data rendering of a Web table according to claim 3, characterized in that: The method further comprises: After the blocks above and to the left of the cell independent of the block are expanded, the data to be filled in the cell is obtained according to the configuration information of the cell independent of the block, and the data to be filled is rendered to the cell independent of the block for display.
5. The method for dynamic data rendering of a Web table according to claim 1, characterized in that: The expansion direction includes downward expansion or rightward expansion; the expansion method includes group expansion or list expansion. When the expansion method is group expansion, the block configuration data further includes a group field.
6. The method for dynamic data rendering of a Web table according to claim 5, characterized in that: The configuration information of the cell is a constant, a reference field or a calculation formula; wherein, for the reference field, when the expansion method is group expansion, the configuration information of the cell also includes a display method of the reference field.
7. A dynamic data rendering device for a Web table, characterized in that: include: An acquisition module, used to: acquire configuration data of the Web form; wherein the configuration data includes block configuration data of at least one block, and the block configuration data includes location information, expansion direction, expansion mode, data set and configuration information of cells in the block; A parsing module, configured to: parse the block configuration data to obtain at least one tree structure; wherein the tree structure corresponds to an independent block or a nested block, and in the tree structure corresponding to the nested block, the nesting relationship between the parent and child blocks represents the dependency relationship between the blocks; An expansion module, used to: dynamically expand the blocks corresponding to each of the tree structures based on the block configuration data and a preset block expansion sequence, to obtain data to be filled in the cells of the expanded blocks; wherein the blocks located in the expansion direction of the dynamically expanded blocks update their positions following the expansion of the blocks; A rendering module, used to: render the data to be filled into cells corresponding to each block for display; The preset block extension sequence includes: According to the block configuration data, if the upper root node block among the root node blocks of different tree structures includes a block that is extended downward, the block in the tree structure corresponding to the upper root node block is preferentially extended; if the left root node block among the root node blocks of different tree structures includes a block that is extended rightward, the block in the tree structure corresponding to the left root node block is preferentially extended; The dynamically expanding the blocks corresponding to each of the tree structures includes: In the order of the node levels in the tree structure from low to high, the instantiated data is acquired cyclically according to the expansion mode of the parent node block and the corresponding data set, and the parent node block is dynamically expanded according to the number of rows and columns occupied by the parent node block, the expansion direction and expansion mode of the parent node block for each instantiated data; Among them, if the parent node block includes a child node block, each time the instantiation data of the parent node block is obtained, the child node block is dynamically expanded according to the expansion method, expansion direction and corresponding data set of the child node block; if the upper block among the same-level blocks contains a block that expands downward, the upper block is expanded first; if the left block among the same-level blocks contains a block that expands rightward, the left block is expanded first.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the dynamic data rendering method of the Web table according to any one of claims 1 to 6 is implemented.
