Report generation method and system based on visual configuration report template
By introducing visual configuration templates and a unified document processing engine in the report generation system, the problems of inflexible report style adjustment, fixed output format and low development efficiency are solved, and flexible report style adjustment, multiple output format support and efficient development process are realized.
Patent Information
- Application Number
- CN202411563752.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the report style adjustment is inflexible, the output format is fixed, and the custom development efficiency is low, making it difficult to meet the frequently changing data and different reporting requirements in the manufacturing industry.
The method of configuring report templates based on visual configuration is adopted, and the component format standards are described through JSON data format, the report component document processing is unified, multiple output formats are dynamically supported, and the report function is quickly configured through a low-code system.
It realizes flexible adjustment of report styles, support of multiple output formats, and significant improvement in development efficiency, which can quickly respond to users' business report needs and improve production efficiency and user experience.
Smart Images

Figure CN119718290A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of low-code configurable report generation technology, and in particular to a report generation method and system based on a visually configured report template. Background Art
[0002] In the manufacturing industry, reports are an important part of the contemporary business system. Due to the complexity and diversity of reports, how to quickly and timely respond to user business needs is crucial to the construction of factory digital systems and the improvement of production efficiency. The existing report generation technology has the following technical problems:
[0003] (1) The report style adjustment is not flexible;
[0004] (2) The report output format is fixed;
[0005] (3) Custom development efficiency is low.
[0006] Therefore, for enterprises that want to improve their report management processes, especially those in the manufacturing industry that face frequently changing data and different report styles, there is a technical demand for developing new report generation methods and systems. Summary of the invention
[0007] In order to solve the problems existing in the prior art, the present invention aims at the problems of inflexible adjustment of report style, fixed output format and low development efficiency in current report generation, and provides a report generation method and system based on visual configuration report template, which describes the component format standard based on JSON data format, unifies and integrates the report component document processing mode, and aims to meet the requirements of diverse report styles and output of multiple document formats, and improve development efficiency. This technical solution is suitable for all enterprises that hope to improve their report management process, especially those manufacturing industries that face frequently changing data and different style report requirements.
[0008] Specific:
[0009] (1) To address the problem of inflexible report style adjustment, the present invention implements report style adjustment through a visual configuration template, allowing system operation and maintenance personnel to configure the style and attribute fields according to user requirements anytime and anywhere;
[0010] (2) In order to solve the problem of fixed report output format, the present invention dynamically supports configuration of output format, and selects corresponding Excel / Word / PDF document format according to user needs to realize configurable mode;
[0011] (3) To address the problem of low efficiency in customized development, the present invention uses the configurable function of the system to dynamically output corresponding reports based on templates, thereby achieving low-code reporting functions and solving the problem of repeated development work.
[0012] On one hand, the present invention provides a report generation method based on a visual configuration report template, comprising:
[0013] S1, predefining a report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component;
[0014] S2, constructing a visualization configuration template, and performing report configuration through the visualization configuration template to form a content report template;
[0015] S3, adding and rendering a business report function to a content report template through the visualization configuration template;
[0016] S4, based on the integrated template document processing engine of the unified report processing center, the content report template of the rendering business report function is scheduled to form a final report, and the final report is output.
[0017] Preferably, the predefinition of the report component includes defining: report component name, component interface address, request method and interface parameters; the format description of the data returned by the report component includes: field attributes, description, data type and data format.
[0018] Preferably, the data type includes one or more of a string, a date and a number; and the data format includes a date format and / or a number format.
[0019] Preferably, S2 includes:
[0020] S21, constructing a visualization configuration template, wherein the visualization configuration template includes a visualization configuration interface;
[0021] S22, configuring the required report template through the visual configuration template, including:
[0022] (1) quickly building a primary report template by dragging or selecting style configuration options in the visualization configuration interface; wherein the style configuration options include fonts, colors, borders, backgrounds, headers and footers to meet the personalized needs of different user roles;
[0023] (2) setting the report document format of the primary report template to form a format report template, wherein the report document format includes a format selection for each style configuration option;
[0024] (3) Binding the format report template to the predefined report component by pulling based on the visual configuration template, describing the report field attributes using the JSON data format based on the predefined report component, and providing a field attribute mapping function for the format report template;
[0025] (4) After the fields in the data source are associated with the content in the format report template, the format report template forms a content report template. The association definition includes: using placeholders to define a format setting report template-field mapping relationship, and the specific format is: {field attributes}.
[0026] Preferably, S3 includes:
[0027] S31, configuring the content report template to a specified business function page;
[0028] S32, based on the standardized interactive interface, adding dynamic rendering function keys to the front end, dynamically rendering and displaying corresponding report functions; based on the standardized interactive interface, linking the back end to a unified report processing center; wherein, the front end dynamically renders and displays corresponding report functions through standardized components, and when the user uses the corresponding report function, it triggers the call to the unified report processing center of the back end.
[0029] Preferably, S4 includes:
[0030] S41, acquiring template data and report predefined component data defined in the content report template of the rendering business report function through the unified report processing center; the template data and report predefined component data correspond to the report format of the content report template of the rendering business report function;
[0031] S42, obtaining, through the unified report processing center, a document processing engine corresponding to the report format from among all integrated template document processing engines; wherein the document processing engine is based on a plug-in development model and integrates support for Excel, Word, PDF, HTML or CSV format processing;
[0032] S43, matching the output format of the content report template of the rendering business report function based on the document processing engine and forming the final report;
[0033] S44, calculating the conditional hash of the content report template of the rendering business report function, and caching the corresponding report document address based on the conditional hash;
[0034] S45: Return and output the final report corresponding to the content report template of the rendering business report function based on the report document address.
[0035] Preferably, the S45 includes:
[0036] For the final report with the same conditions, retain the final report with configurable duration;
[0037] Determining whether the final report exists in the cache and performing corresponding operations according to the determination result includes:
[0038] When the final report exists in the cache, the final report corresponding to the content report template of the rendering business report function is directly obtained from the cache and returned and output;
[0039] When the final report does not exist in the cache, the content report template and interface data with the business report rendering function are obtained, a document corresponding to the content report template with the business report rendering function is generated, and then the final report is reconstructed after document parsing, and the final report is returned and output.
[0040] A second aspect of the present invention is to provide a report generation system based on a visually configured report template, which is used to execute the report generation method based on a visually configured report template of the first aspect, comprising:
[0041] A report component predefinition module (101), used for predefining a report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component;
[0042] A visualization configuration template construction and configuration module (102), used to construct a visualization configuration template, and to perform report configuration through the visualization configuration template to form a content report template;
[0043] A rendering function module (103), used to add and render a business report function to a content report template through the visual configuration template;
[0044] The format scheduling and output module (104) is used to schedule the report format of the content report template of the rendering business report function based on the integrated template document processing engine of the unified report processing center to form a final report and output the final report.
[0045] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is configured to read the instructions and execute the method described in the first aspect.
[0046] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the plurality of instructions can be read by a processor to execute the method described in the first aspect.
[0047] The method, system and electronic device provided by the present invention have the following beneficial effects:
[0048] This technical solution meets the needs of diversified business reporting requirements by defining report component interfaces, template configuration, and integrated template processing engines. On the one hand, it reduces development workload, achieves low-code development, and improves efficiency through a unified processing center. On the other hand, it can quickly respond to users' business reporting needs and output a report document with only simple configuration, greatly supporting business system functions, improving user experience and satisfaction, and creating system value. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of the report generation method based on the visual configuration report template described in the present invention.
[0050] Figure 2 The present invention is a schematic diagram of the report generation method based on the visual configuration report template.
[0051] Figure 3 This is a schematic flow chart of step S2 of the present invention.
[0052] Figure 4 This is a schematic flow chart of step S3 of the present invention.
[0053] Figure 5 This is a schematic flow chart of step S4 of the present invention.
[0054] Figure 6 This is a flow chart of the working principle of the template processing engine described in the present invention.
[0055] Figure 7 It is a schematic diagram of the architecture of the report generation system based on the visual configuration report template described in the present invention.
[0056] Figure 8 The figure is a schematic diagram of the structure of the electronic device described in the present invention. DETAILED DESCRIPTION
[0057] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0058] Embodiment 1
[0059] See also Figure 1-2 This embodiment provides a report generation method based on a visual configuration report template, including:
[0060] S1, predefining a report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component;
[0061] As a preferred implementation, the predefinition of the report component includes defining: the report component name, the component interface address, the request method and the interface parameters; the format description of the data returned by the report component includes: field attributes, description, data type (such as: one or more of a string, a date and a number) and a data format (such as: a date format and / or a number format).
[0062] S2, constructing a visualization configuration template, and performing report configuration through the visualization configuration template to form a content report template.
[0063] See also Figure 3 As a preferred implementation, S2 includes:
[0064] S21, constructing a visualization configuration template, wherein the visualization configuration template includes a visualization configuration interface;
[0065] S22, configuring the required report template through the visual configuration template, including:
[0066] (1) quickly building a primary report template by dragging or selecting style configuration options in the visualization configuration interface; wherein the style configuration options include fonts, colors, borders, backgrounds, headers and footers to meet the personalized needs of different user roles;
[0067] (2) setting the report document format of the primary report template to form a format report template, wherein the report document format includes a format selection for each style configuration option;
[0068] (3) Binding the format report template to the predefined report component by pulling based on the visual configuration template, describing the report field attributes using the JSON data format based on the predefined report component, and providing a field attribute mapping function for the format report template;
[0069] (4) After the fields in the data source are associated with the content in the format report template, the format report template forms a content report template. The association definition includes: using placeholders to define a format setting report template-field mapping relationship, and the specific format is: {field attributes}.
[0070] The visualization configuration template constructed in this embodiment S2 can:
[0071] (1) Provide a visual configuration interface, allowing system operation and maintenance personnel to quickly build report templates by dragging and selecting to set the report document format;
[0072] (2) Supports a wide range of style configuration options, including fonts, colors, borders, backgrounds, headers and footers, etc., to meet the personalized needs of different user roles;
[0073] (3) The visual configuration template can be bound to the predefined report component by pulling. Based on the predefined report component, the report field attributes are described in JSON data format, providing field attribute mapping function;
[0074] (4) It can allow users to define the association between fields in the data source and the content in the report template. The association definition includes: using the placeholder definition format: {field attribute}, setting the report template-field mapping relationship.
[0075] S3, adding and rendering a business report function to the content report template through the visualization configuration template.
[0076] See also Figure 4 As a preferred implementation, S3 includes:
[0077] S31, configuring the content report template to a specified business function page;
[0078] S32, based on the standardized interactive interface, adding dynamic rendering function keys to the front end, dynamically rendering and displaying corresponding report functions; based on the standardized interactive interface, linking the back end to a unified report processing center; wherein, the front end dynamically renders and displays corresponding report functions through standardized components, and when the user uses the corresponding report function, it triggers the call to the unified report processing center of the back end.
[0079] S4, based on the integrated template document processing engine of the unified report processing center, the content report template of the rendering business report function is scheduled to form a final report, and the final report is output.
[0080] See also Figure 5 As a preferred implementation, S4 includes:
[0081] S41, acquiring template data and report predefined component data defined in the content report template of the rendering business report function through the unified report processing center; the template data and report predefined component data correspond to the report format of the content report template of the rendering business report function;
[0082] S42, obtaining, through the unified report processing center, a document processing engine corresponding to the report format from among all integrated template document processing engines; wherein the document processing engine is based on a plug-in development model and integrates support for Excel, Word, PDF, HTML or CSV format processing;
[0083] S43, matching the output format of the content report template of the rendering business report function based on the document processing engine and forming the final report;
[0084] S44, calculating the conditional hash of the content report template of the rendering business report function, and caching the corresponding report document address based on the conditional hash;
[0085] S45: Return and output the final report corresponding to the content report template of the rendering business report function based on the report document address.
[0086] As a preferred implementation, the S45 includes:
[0087] For the final report with the same conditions, retain the final report with configurable duration;
[0088] Determining whether the final report exists in the cache and performing corresponding operations according to the determination result includes:
[0089] When the final report exists in the cache, the final report corresponding to the content report template of the rendering business report function is directly obtained from the cache and returned and output;
[0090] When the final report does not exist in the cache, the content report template and interface data with the business report rendering function are obtained, a document corresponding to the content report template with the business report rendering function is generated, and then the final report is reconstructed after document parsing, and the final report is returned and output.
[0091] In this embodiment, the unified report processing center is the entire business process processing center, which is mainly responsible for obtaining the defined template data, uniformly processing the data acquisition of report components, and scheduling different document processing engines according to different report formats. Its document processing engine is based on a plug-in development model. The document processing engine is based on a plug-in development model and integrates support for Excel, Word, PDF, HTML or CSV format processing; based on the report condition hash, the corresponding report document address is cached; finally, the corresponding report document is returned and output; mainly considering that document parsing and generation are very resource-consuming, a cache mechanism is introduced. For reports with the same conditions, the default retention is 1 day (configurable). When the report exists, it is directly obtained and returned from the cache. If it does not exist, the template, interface data acquisition and document parsing generation are performed. The report component is called uniformly; the report data and template data rendering are processed; the corresponding report document is generated and output.
[0092] like Figure 6 As shown, the workflow of the integrated template processing engine includes: after starting, obtaining the business report function and sending it to the unified report processing center, judging whether the report exists, if so, directly outputting the document and ending, if the corresponding report does not exist, sending it to the report document processing engine, and sending it to the PDF processing engine, Word processing engine or Excel processing engine according to the expected processing format of PDF, Word or Excel, and then the processing engine of the corresponding format caches the report in the corresponding space, and outputs the document and ends the process after it is retrieved.
[0093] Embodiment 2
[0094] like Figure 7 As shown, this embodiment provides a report generation system based on a visual configuration report template, which is used to execute the report generation method based on a visual configuration report template of embodiment 1, including:
[0095] The report component predefinition module 101 is used to predefine the report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component;
[0096] A visualization configuration template construction and configuration module 102 is used to construct a visualization configuration template and perform report configuration through the visualization configuration template to form a content report template;
[0097] A rendering function module 103, used to add and render a business report function to a content report template through the visualization configuration template;
[0098] The format scheduling and output module 104 is used to schedule the report format of the content report template of the rendering business report function based on the integrated template document processing engine of the unified report processing center to form a final report and output the final report.
[0099] The present invention also provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method as in the first embodiment.
[0100] like Figure 8 As shown, the present invention also provides an electronic device, including a processor 301 and a memory 302 connected to the processor 301, the memory 302 stores a plurality of instructions, and the instructions can be loaded and executed by the processor so that the processor can execute the method as in the first embodiment.
[0101] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A report generation method based on a visual configuration report template, characterized in that: include: S1, predefining a report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component; S2, constructing a visualization configuration template, and performing report configuration through the visualization configuration template to form a content report template; S3, adding and rendering a business report function to a content report template through the visualization configuration template; S4, based on the integrated template document processing engine of the unified report processing center, the content report template of the rendering business report function is scheduled to form a final report, and the final report is output.
2. A report generation method based on a visual configuration report template according to claim 1, characterized in that: The predefinition of the report component includes defining: the report component name, component interface address, request method and interface parameters; the format description of the data returned by the report component includes: field attributes, description, data type and data format.
3. A report generation method based on a visual configuration report template according to claim 2, characterized in that: The data type includes one or more of a string, a date, and a number; the data format includes a date format and / or a number format.
4. A report generation method based on a visual configuration report template according to claim 3, characterized in that: The S2 includes: S21, constructing a visualization configuration template, wherein the visualization configuration template includes a visualization configuration interface; S22, configuring the required report template through the visual configuration template, including: (1) quickly building a primary report template by dragging or selecting style configuration options in the visual configuration interface; wherein the style configuration options include fonts, colors, borders, backgrounds, headers and footers to meet the personalized needs of different user roles; (2) setting the report document format of the primary report template to form a format report template, wherein the report document format includes a format selection for each style configuration option; (3) Binding the format report template to the predefined report component by pulling based on the visual configuration template, describing the report field attributes using the JSON data format based on the predefined report component, and providing a field attribute mapping function for the format report template; (4) After the fields in the data source are associated with the content in the format report template, the format report template forms a content report template. The association definition includes: using placeholders to define a format setting report template-field mapping relationship, and the specific format is: {field attributes}.
5. A report generation method based on a visual configuration report template according to claim 4, characterized in that: The S3 includes: S31, configuring the content report template to a specified business function page; S32, based on the standardized interactive interface, adding dynamic rendering function keys to the front end, dynamically rendering and displaying corresponding report functions; based on the standardized interactive interface, linking the back end to a unified report processing center; wherein, the front end dynamically renders and displays corresponding report functions through standardized components, and when the user uses the corresponding report function, it triggers the call to the unified report processing center of the back end.
6. A report generation method based on a visual configuration report template according to claim 5, characterized in that: The S4 includes: S41, acquiring template data and report predefined component data defined in the content report template of the rendering business report function through the unified report processing center; the template data and report predefined component data correspond to the report format of the content report template of the rendering business report function; S42, obtaining, through the unified report processing center, a document processing engine corresponding to the report format from among all integrated template document processing engines; wherein the document processing engine is based on a plug-in development model and integrates support for Excel, Word, PDF, HTML or CSV format processing; S43, matching the output format of the content report template of the rendering business report function based on the document processing engine and forming the final report; S44, calculating the conditional hash of the content report template of the rendering business report function, and caching the corresponding report document address based on the conditional hash; S45: Return and output the final report corresponding to the content report template of the rendering business report function based on the report document address.
7. A report generation method based on a visually configured report template according to claim 6, characterized in that: The S45 includes: For the final report with the same conditions, retain the final report with configurable duration; Determining whether the final report exists in the cache and performing corresponding operations according to the determination result includes: When the final report exists in the cache, the final report corresponding to the content report template of the rendering business report function is directly obtained from the cache and returned and output; When the final report does not exist in the cache, the content report template and interface data with the business report rendering function are obtained, a document corresponding to the content report template with the business report rendering function is generated, and then the final report is reconstructed after document parsing, and the final report is returned and output.
8. A report generation system based on a visual configuration report template, used to execute the report generation method based on a visual configuration report template according to any one of claims 1 to 7, characterized in that: include: A report component predefinition module (101), used for predefining a report component to form a report predefined component, wherein the report predefined component includes a definition of the report component described in JSON format and a format description of data returned by the report component; A visualization configuration template construction and configuration module (102), used to construct a visualization configuration template, and to perform report configuration through the visualization configuration template to form a content report template; A rendering function module (103), used to add and render a business report function to a content report template through the visual configuration template; The format scheduling and output module (104) is used to schedule the report format of the content report template of the rendering business report function based on the integrated template document processing engine of the unified report processing center to form a final report and output the final report.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the plurality of instructions can be read by a processor to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
SAAS system customized report generation method and device based on dynamic template configuration
CN121168434A
Saas system customization report generation method and device based on dynamic template configuration
CN121168434B
AI-driven multi-source data scheduling method and system oriented to ERP report generation
CN121212101A
AI-driven multi-source data scheduling method and system for ERP report generation
CN121212101B