Dynamic report generation method, device, equipment and storage medium

By analyzing Excel report template files and modifying configuration item parameters, the preview report style is generated, which solves the problem that traditional report design is difficult to adapt to business needs, and realizes flexible editing and dynamic design of report styles, improving report generation efficiency and metadata accuracy sex.

CN118643815BActive Publication Date: 2025-01-07深圳市金政软件技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411107816.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-01-07
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Traditional report design requires professional designers or complex programming, which is difficult to adapt to frequently changing business needs. The difference between report metadata and templates leads to inconsistent report generation and templates, and there are serious metadata loss problems.

Method used

By analyzing Excel report template files, obtaining and modifying configuration item parameters, generating a preview report style and determining that it complies with the preset style and filling rules, and if it complies with the final report, it will generate a final report to achieve flexible editing and dynamic design of report styles.

Benefits of technology

No need to modify the code, quickly adjust and design report styles, meet different business needs, improve report generation efficiency, and ensure the accuracy and consistency of report metadata.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643815B_ABST
    Figure CN118643815B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computers, and discloses a method, device, equipment and storage medium for generating dynamic reports. The method comprises: obtaining an imported Excel report template file; parsing the Excel report template file, reading the cell data in the Excel report template file, and obtaining the annotations on the cells; obtaining the configuration item parameters of the modified report items, report fields and project field values, and obtaining the report style according to the configuration item parameters of the modified report items, report fields and project field values; extracting report metadata from the Excel report template file, generating a preview report style according to the report metadata and the report style, and judging whether the preview report complies with the preset style and reporting rules; if it complies, generating a report according to the preview report style. In the embodiment of the present invention, the needs of different report services can be met, and the report generation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a dynamic report generation method, device, equipment and storage medium. Background Art

[0002] In government and enterprise informatization, financial statements and other reporting systems, report style editing and generation is an important link. In the process of data analysis and report generation, flexible editing and dynamic design of report styles are crucial to improving work efficiency and meeting user needs.

[0003] Traditional report design usually requires professional report designers or complex programming, and it is difficult to adapt to the frequently changing business and complex report style diversification and personalization needs. In particular, when the changes in report style templates and the differences in report metadata in the system are not analyzed, there will be serious loss of report metadata, resulting in inconsistency between report data generated by the report system and the template. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem of how to meet the needs of different report services and improve the efficiency of report generation.

[0005] A first aspect of the present invention provides a dynamic report generation method, the dynamic report generation method comprising:

[0006] Obtain an imported Excel report template file, wherein the Excel report template file includes report items, report fields, and item field values;

[0007] Parsing the Excel report template file, reading the cell data in the Excel report template file, and obtaining the annotations on the cells, wherein the annotations are personalized configuration item parameters of the report items, the report fields, and the item field values, and the configuration item parameters are parameters used in the report style;

[0008] Acquire the modified configuration item parameters of the report item, the report field and the item field value, and obtain the report style according to the modified configuration item parameters of the report item, the report field and the item field value;

[0009] Extracting report metadata from the Excel report template file, generating a preview report style according to the report metadata and the report style, and determining whether the preview report complies with a preset style and reporting rules;

[0010] If it meets the requirements, a report is generated according to the preview report style.

[0011] Optionally, in a first implementation of the first aspect of the present invention, parsing the Excel report template file, reading cell data in the Excel report template file, and obtaining comments on the cells includes:

[0012] Parse the Excel report template file and read the Sheet pages in the Excel report template file in sequence;

[0013] Read the cell data in the Sheet page and obtain the comments on the cell;

[0014] According to the annotation on the cell, determining whether there is a preset configuration item parameter on the cell;

[0015] If yes, then the value of the preset configuration item parameter is set.

[0016] Optionally, in a second implementation of the first aspect of the present invention, reading the cell data in the Sheet page includes:

[0017] Identify the background color of the cells in the Sheet page;

[0018] According to the background color of the cell, the position range of the report item, the report field and the item field value on the Sheet page is obtained;

[0019] According to the position range of the report item, the report field and the item field value on the Sheet page, the cell data of the report item, the report field and the item field value are read.

[0020] Optionally, in a third implementation of the first aspect of the present invention, obtaining the position range of the report item, the report field, and the item field value on the Sheet page according to the background color of the cell includes:

[0021] According to the background color of the cell, mark the start position and end position of the report item on the Sheet page, and mark the start position and end position of the report field on the Sheet page;

[0022] According to the marked start position and end position of the report item on the Sheet page, obtain the position range of the report item on the Sheet page;

[0023] According to the marked start position and end position of the report field on the Sheet page, obtain the position range of the report field on the Sheet page;

[0024] The position range of the item field value on the Sheet page is obtained according to the intersection position where the report item and the report field start, and the intersection position where the report item and the report field end.

[0025] Optionally, in a fourth implementation of the first aspect of the present invention, before obtaining the imported Excel report template file, the process further includes:

[0026] Create or obtain an Excel report template file;

[0027] By specifying a label column in the Excel report template file, setting the column where the report item is located;

[0028] Set the row where the report fields are located by specifying the label row in the Excel report template file.

[0029] Optionally, in a fifth implementation manner of the first aspect of the present invention, before obtaining the modified configuration item parameters of the report item, the report field, and the item field value, the following further includes:

[0030] Determine whether the configuration item parameters of the report item and the report field need to be rewritten;

[0031] If necessary, a prompt message is pushed, where the prompt message is used to prompt the configuration item parameters that need to be rewritten.

[0032] Optionally, in a sixth implementation of the first aspect of the present invention, the configuration item parameters include a data type, a data display format, and at least one of a data source and a formula for a project field value.

[0033] A second aspect of the present invention provides a dynamic report generation device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the dynamic report generation device executes the above-mentioned dynamic report generation method.

[0034] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned dynamic report generation method.

[0035] In an embodiment of the present invention, an imported Excel report template file is obtained, wherein the Excel report template file includes report items, report fields, and project field values; the Excel report template file is parsed, the cell data in the Excel report template file is read, and the annotations on the cells are obtained, wherein the annotations are personalized configuration item parameters of the report items, the report fields, and the project field values, and the configuration item parameters are parameters used in the report style; the modified configuration item parameters of the report items, the report fields, and the project field values ​​are obtained, and the report style is obtained according to the modified configuration item parameters of the report items, the report fields, and the project field values; the report metadata is extracted from the Excel report template file, and a preview report style is generated according to the report metadata and the report style, and it is determined whether the preview report conforms to the preset style and reporting rules; if it conforms, a report is generated according to the preview report style. In the present invention, by parsing the Excel report template file, the basic framework and row and column styles of the report can be read, and by modifying the configuration item parameters, the style of the report can be quickly adjusted and designed to meet the needs of different report services, without modifying the code, and the report service requirements can be quickly completed, thereby improving the efficiency of report generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of an embodiment of a dynamic report generation method in an embodiment of the present invention;

[0037] Figure 2 This is a schematic diagram of the data location range of a report cell in an embodiment of the present invention;

[0038] Figure 3 This is a schematic diagram of report field annotation configuration items in an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of an embodiment of a dynamic report generation device in an embodiment of the present invention;

[0040] Figure 5 The figure is a schematic diagram of an embodiment of a dynamic report generation device in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The embodiments of the present invention provide a dynamic report generation method, device, equipment and storage medium.

[0042] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0043] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0044] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the dynamic report generation method in the embodiment of the present invention includes:

[0045] S100, obtaining an imported Excel report template file.

[0046] In this embodiment, the report style is changed dynamically by quickly adjusting the Excel report template file based on Excel software. First, the user or implementation personnel designs the system report on the Excel report template file, wherein the system report style or parameters are designed or edited offline, and then the Excel report template file is imported into the report system, wherein the Excel report template file includes report items, report fields, and item field values.

[0047] S200, parsing the Excel report template file, reading the cell data in the Excel report template file, and obtaining the comments on the cells.

[0048] In this embodiment, the cells of report items, report fields and project field values ​​have their own corresponding comments. The comments on the report item cells are personalized configuration item parameters of the report items; the comments on the report field cells are personalized configuration item parameters of the report fields; the comments on the project field value cells are personalized configuration item parameters of the project field values. Among them, the configuration item parameters are the parameters used in the report style, and the configuration item parameters of the report items are as follows: project name, project alias (both are the content in the cell by default), and encoding (coordinates by default). The configuration item parameters of the report fields are as follows: field name, field alias (both are the content in the cell by default), encoding (coordinates by default). Unique identification is performed through encoding. Some report items will specify encoding, some will not specify encoding, and some have encoding but are not displayed. When designing an Excel report template file, the style editing of the Excel report template file is realized by editing the comments of the cells in the Excel report template file.

[0049] S300, obtaining the configuration item parameters of the modified report items, report fields and project field values, and obtaining the report style according to the configuration item parameters of the modified report items, report fields and project field values.

[0050] In this embodiment, the Excel report template file is parsed to identify the format and structure of the Excel report template file, including special instructions and configuration item parameters of report items, fields, and cell comments. If the style of the Excel report template file needs to be changed after parsing, the configuration item parameters of the corresponding cells are modified. For example, if the font size of the report item is to be changed, the configuration item parameters of the font corresponding to the report item cell are modified. Then, after modifying the configuration item parameters, the report style is obtained according to the modified configuration item parameters.

[0051] S400, extracting report metadata from the Excel report template file, generating a preview report style according to the report metadata and the report style, and determining whether the preview report complies with a preset style and reporting rules.

[0052] In this embodiment, report metadata is extracted, which refers to data describing report cell data. The name, location, size and other basic information of fields and items in the parsed Excel file are used to build the basic framework, style and layout of the report. After importing the Excel report template file into the report system, the report style and metadata are automatically extracted, which greatly improves the efficiency of report design and the accuracy of report metadata, including data information such as name, coordinates, style, data format, and data retrieval rules.

[0053] S500: If the conditions are met, a report is generated according to the preview report style.

[0054] In this embodiment, a preview report style is first generated at the terminal based on the report metadata and report style. The user first previews the report to determine whether it conforms to the preset style and reporting rules. If so, the value corresponding to the project field is read from the database and combined with the report style to generate the final report.

[0055] In an optional implementation of the first aspect of the present invention, parsing the Excel report template file, reading the cell data in the Excel report template file, and obtaining the comments on the cells include:

[0056] Parse the Excel report template file, read the Sheet pages in the Excel report template file in sequence; read the cell data in the Sheet page and obtain the comments on the cell; determine whether there are preset configuration item parameters on the cell according to the comments on the cell; if so, set the value of the preset configuration item parameter.

[0057] In this embodiment, an Excel report template file containing report style design information is imported into the report system. The system reads the style in the Sheet page in the Excel report template file as the report style, reads the Sheet page in sequence, reads the cells in the Sheet page, collects the data of the cells, and finds whether there is a configuration item for the parameter in the cell annotation according to the needs of the parameters in the report system. If so, the value of the parameter is set. The style report metadata information of the read report items and fields is saved in the database together to provide report style metadata when the report is generated and restore the style of the report.

[0058] In an optional implementation of the first aspect of the present invention, reading the cell data in the Sheet page includes:

[0059] Identify the background color of cells in the Sheet page; obtain the position range of report items, report fields and project field values ​​on the Sheet page based on the background color of the cells; read the cell data of report items, report fields and project field values ​​based on the position range of report items, report fields and project field values ​​on the Sheet page.

[0060] In this embodiment, when editing an Excel report template file, the background color of the cell will be marked to distinguish the position range of the report item, report field and item field value, such as Figure 2As shown, area a is the report item, area b is the report field, and area c is the project field value. Optionally, the position range of the report item, report field, and project field value can also be defined in the cell annotation. During parsing, the Sheet pages are read in sequence, and then the background color of the cells in the Sheet page is identified or the cell annotations in the Sheet page are read to obtain the position range of the report item, report field, and project field value on the Sheet page, thereby obtaining the cell data of the report item, report field, and project field value.

[0061] In an optional implementation of the first aspect of the present invention, obtaining the position range of the report item, report field and item field value on the Sheet page according to the background color of the cell includes:

[0062] According to the background color of the cell, mark the start and end positions of the report item on the Sheet page, and mark the start and end positions of the report field on the Sheet page; according to the start and end positions of the marked report item on the Sheet page, get the position range of the report item on the Sheet page; according to the start and end positions of the marked report field on the Sheet page, get the position range of the report field on the Sheet page; according to the intersection position of the start of the report item and the report field, and the intersection position of the end of the report item and the report field, get the position range of the item field value on the Sheet page.

[0063] In this embodiment, starting from marking the background color of the cell, the report item is identified as a valid item in the report from the beginning to the end or the end mark of the Sheet page, and the cell data of the report item between the two are read in sequence. The content of the default cell is the project name of the report, the coordinates are the report item code, and the annotations are personalized configuration item parameters. The configuration item parameters include but are not limited to: project name, project alias, project full name, project code, fixed row floating row total row mark, up or down floating mark, business parameter mark and other parameters.

[0064] Mark the report field. From the beginning of the Sheet page to the end of the field or the end mark, it is the valid field list of the report. The cell data of the report field between the two is read in sequence. The default cell content is the field name of the report (such as the beginning of the year and the end of the year); the coordinate is the report field code. If you need to customize it, JE1, JE2, and JE3 represent the code of the report field; the cell comment is the parameter of the personalized configuration item. Adjust the personalized parameters of the report style, such as Figure 3 As shown, the configuration items of the report field include but are not limited to parameters such as field name, field alias, field code, multi-line header, data format, data type, etc.

[0065] The matrix area at the intersection of the report item and report field and the intersection of the report item and report field is a list of report item field values. The cell contents of the area read in sequence are value formulas or calculation formulas, the coordinates are project field codes, and the comments are personalized configuration item parameters. The configuration parameters include but are not limited to: default values, verification formats, calculation formulas, value formulas, data formats, read-only tags, non-value-filled tags and other parameters.

[0066] In an optional implementation manner of the first aspect of the present invention, before obtaining the imported Excel report template file, the method further includes:

[0067] Create or obtain an Excel report template file; set the column where the report item is located by specifying a marked column in the Excel report template file; set the row where the report field is located by specifying a marked row in the Excel report template file.

[0068] In this embodiment, before importing the Excel report template file, design the report item, set the column of the report item by specifying the marked column, the default is the first column, and set the report item in the column where the report item is located; design the report field, set the row of the report field by specifying the marked row, the default is the second row, and set the report field in the row where the report field is located. Then, edit the comments of the cells of each report item or account (row data) and report field (column data), write the corresponding parameters of the configuration item, and after editing, import it into the report system for parsing and report metadata extraction.

[0069] In an optional implementation manner of the first aspect of the present invention, before obtaining the configuration item parameters of the modified report item, report field and item field value, the method further includes:

[0070] Determine whether the configuration item parameters of the report items and report fields need to be rewritten; if necessary, push prompt information, which is used to indicate the configuration item parameters that need to be rewritten.

[0071] In this embodiment, some of the configuration item parameters of the report project need to be rewritten, such as modifying the project alias. The names of the last-level items in the hierarchical report projects may be the same or not easily recognized by the user, so they can be renamed. Some of the configuration item parameters of the report fields also need to be rewritten, such as modifying the field alias. The names of the last-level fields in the report fields with multiple header relationships may be the same or not easily recognized by the user, so they can be renamed, or for the data display format of the field (column), set the data display format such as #.##%, that is, retain 2 decimal places for percentages and other style parameters. After obtaining the imported Excel report template file, it is necessary to first determine whether the configuration item parameters of the report project and report field need to be rewritten. If rewriting is required, a prompt message will be pushed to prompt the user of the configuration item parameters that need to be rewritten.

[0072] In an optional implementation of the first aspect of the present invention, the configuration item parameters include a data type, a data display format, and at least one of a data source and a formula for obtaining a project field value.

[0073] In this embodiment, the configuration item parameters include data types, such as numbers, text, and dates; data display formats, such as amounts, percentages, decimal places, date formatting, and data sources and formulas for project field values.

[0074] See also Figure 4 A second aspect of the present invention provides a dynamic report generation device, the dynamic report generation device comprising:

[0075] The report template acquisition module 10 is used to acquire an imported Excel report template file, wherein the Excel report template file includes report items, report fields and item field values;

[0076] The cell parsing module 20 is used to parse the Excel report template file, read the cell data in the Excel report template file, and obtain the comments on the cells. The comments are personalized configuration item parameters of the report items, report fields and item field values. The configuration item parameters are parameters used in the report style.

[0077] The report style configuration module 30 is used to obtain the configuration item parameters of the modified report items, report fields and item field values, and obtain the report style according to the configuration item parameters of the modified report items, report fields and item field values;

[0078] The report preview module 40 is used to extract report metadata from the Excel report template file, generate a preview report style according to the report metadata and the report style, and determine whether the preview report conforms to the preset style and filling rules;

[0079] The report generation module 50 is used to generate a report according to the preview report style if it meets the requirements.

[0080] In an optional implementation of the second aspect of the present invention, the cell parsing module 20 is also used to parse the Excel report template file, read the Sheet pages in the Excel report template file in sequence; read the cell data in the Sheet page, and obtain the comments on the cell; based on the comments on the cell, determine whether there are preset configuration item parameters on the cell; if so, set the value of the preset configuration item parameter.

[0081] In an optional implementation of the second aspect of the present invention, the cell parsing module 20 is also used to identify the background color of the cells in the Sheet page; based on the background color of the cells, the position range of the report items, report fields and project field values ​​on the Sheet page is obtained; based on the position range of the report items, report fields and project field values ​​on the Sheet page, the cell data of the report items, report fields and project field values ​​are read.

[0082] In an optional implementation of the second aspect of the present invention, the cell parsing module 20 is also used to mark the start and end positions of the report items on the Sheet page according to the background color of the cell, and to mark the start and end positions of the report fields on the Sheet page; obtain the position range of the report items on the Sheet page according to the start and end positions of the marked report items on the Sheet page; obtain the position range of the report fields on the Sheet page according to the start and end positions of the marked report fields on the Sheet page; obtain the position range of the project field values ​​on the Sheet page according to the intersection position of the start of the report item and the report field, and the intersection position of the end of the report item and the report field.

[0083] In an optional implementation of the second aspect of the present invention, the dynamic report generation device further includes:

[0084] The cell marking module is used to create or obtain an Excel report template file; by specifying a marking column in the Excel report template file, the column where the report item is located is set; by specifying a marking row in the Excel report template file, the row where the report field is located is set.

[0085] In an optional implementation of the second aspect of the present invention, the dynamic report generation device further includes:

[0086] The information prompt module is used to determine whether the configuration item parameters of the report items and report fields need to be rewritten; if necessary, a prompt message is pushed, and the prompt message is used to indicate the configuration item parameters that need to be rewritten.

[0087] Figure 51 is a schematic diagram of the structure of a dynamic report generation device provided by an embodiment of the present invention. The dynamic report generation device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 may be temporary storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the dynamic report generation device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the dynamic report generation device 500.

[0088] The dynamic report generation device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, Free BSD, etc. It will be appreciated by those skilled in the art that Figure 5 The structure of the dynamic report generation device shown does not constitute a limitation on the dynamic report generation device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0089] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the dynamic report generation method.

[0090] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0091] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0092] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A dynamic report generation method, characterized in that: The dynamic report generation method comprises: Obtain an imported Excel report template file, wherein the Excel report template file includes report items, report fields, and item field values; Parsing the Excel report template file, reading the cell data in the Excel report template file, and obtaining the annotations on the cells, wherein the annotations are personalized configuration item parameters of the report items, the report fields, and the item field values, and the configuration item parameters are parameters used in the report style; Acquire the modified configuration item parameters of the report item, the report field and the item field value, and obtain the report style according to the modified configuration item parameters of the report item, the report field and the item field value; Extracting report metadata from the Excel report template file, generating a preview report style according to the report metadata and the report style, and determining whether the preview report complies with a preset style and reporting rules; If it is in compliance, a report is generated according to the preview report style; The parsing of the Excel report template file, reading the cell data in the Excel report template file, and obtaining the annotations on the cells includes: Parse the Excel report template file and read the Sheet pages in the Excel report template file in sequence; Read the cell data in the Sheet page and obtain the comments on the cell; According to the annotation on the cell, determining whether there is a preset configuration item parameter on the cell; If yes, then set the value of the preset configuration item parameter; The Excel report template file containing report style design information is imported into the report system. The report system reads the style in the Sheet page in the Excel report template file as the report style, reads the Sheet page in sequence, reads the cells in the Sheet page, collects the data of the cells, and searches for the configuration items of the parameters in the cell annotation according to the needs of the parameters in the report system. If so, the value of the parameter is set; the read report items and the style report metadata information of the report fields are saved together in the database to provide the report style and metadata when the report is generated, and restore the style of the report.

2. The dynamic report generation method according to claim 1, characterized in that: The reading of the cell data in the Sheet page includes: Identify the background color of the cells in the Sheet page; According to the background color of the cell, the position range of the report item, the report field and the item field value on the Sheet page is obtained; According to the position range of the report item, the report field and the item field value on the Sheet page, the cell data of the report item, the report field and the item field value are read.

3. The dynamic report generation method according to claim 2, characterized in that: The obtaining of the position range of the report item, the report field and the item field value on the Sheet page according to the background color of the cell includes: According to the background color of the cell, mark the start and end positions of the report item on the Sheet page, and mark the start and end positions of the report field on the Sheet page; According to the marked start position and end position of the report item on the Sheet page, obtain the position range of the report item on the Sheet page; According to the marked start position and end position of the report field on the Sheet page, obtain the position range of the report field on the Sheet page; The position range of the item field value on the Sheet page is obtained according to the intersection position where the report item and the report field start, and the intersection position where the report item and the report field end.

4. The dynamic report generation method according to claim 1, characterized in that: Before obtaining the imported Excel report template file, the method further includes: Create or obtain an Excel report template file; By specifying a label column in the Excel report template file, setting the column where the report item is located; Set the row where the report fields are located by specifying the label row in the Excel report template file.

5. The dynamic report generation method according to claim 1, characterized in that: Before obtaining the modified configuration item parameters of the report item, the report field and the item field value, the method further includes: Determine whether the configuration item parameters of the report item and the report field need to be rewritten; If necessary, a prompt message is pushed, where the prompt message is used to prompt the configuration item parameters that need to be rewritten.

6. The dynamic report generation method according to claim 1, characterized in that: The configuration item parameters include at least one of a data type, a data display format, and a data source and a formula for an item field value.

7. A dynamic report generation device, characterized in that: The dynamic report generation device comprises: A report template acquisition module is used to acquire an imported Excel report template file, wherein the Excel report template file includes report items, report fields and item field values; A cell parsing module, used to parse the Excel report template file, read the cell data in the Excel report template file, and obtain the annotations on the cells, wherein the annotations are personalized configuration item parameters of the report items, the report fields, and the item field values, and the configuration item parameters are parameters used in the report style; A report style configuration module, used to obtain the configuration item parameters of the modified report item, the report field and the item field value, and obtain the report style according to the configuration item parameters of the modified report item, the report field and the item field value; A report preview module is used to extract report metadata from the Excel report template file, generate a preview report style according to the report metadata and the report style, and determine whether the preview report conforms to the preset style and reporting rules; A report generation module, used for generating a report according to the preview report style if the conditions are met; The cell parsing module is also used to parse the Excel report template file and read the Sheet pages in the Excel report template file in sequence; Read the cell data in the Sheet page and obtain the comments on the cell; According to the annotation on the cell, determining whether there is a preset configuration item parameter on the cell; If yes, then set the value of the preset configuration item parameter; The Excel report template file containing report style design information is imported into the report system. The report system reads the style in the Sheet page in the Excel report template file as the report style, reads the Sheet page in sequence, reads the cells in the Sheet page, collects the data of the cells, and searches for the configuration items of the parameters in the cell annotation according to the needs of the parameters in the report system. If so, the value of the parameter is set; the read report items and the style report metadata information of the report fields are saved together in the database to provide the report style and metadata when the report is generated, and restore the style of the report.

8. A dynamic report generation device, characterized in that: The dynamic report generation device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the dynamic report generation device to execute the dynamic report generation method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the dynamic report generation method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Report access method and device, storage medium and computer equipment

    CN114118045A

  • Method and device for generating report file

    CN118194837A