CN113822033A - Report generation method, device, equipment and storage medium - Google Patents

Report generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113822033A
CN113822033A CN202011533435.4A CN202011533435A CN113822033A CN 113822033 A CN113822033 A CN 113822033A CN 202011533435 A CN202011533435 A CN 202011533435A CN 113822033 A CN113822033 A CN 113822033A
Authority
CN
China
Prior art keywords
format
report
template
file
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011533435.4A
Other languages
Chinese (zh)
Inventor
任星旺
李秋林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202011533435.4A priority Critical patent/CN113822033A/en
Publication of CN113822033A publication Critical patent/CN113822033A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning

Abstract

The embodiment of the application discloses a report generation method, a report generation device, report generation equipment and a storage medium, and relates to the technical field of software. The method comprises the following steps: acquiring a first format report template which is custom designed by a user; converting the report template in the first format into a report template engine file in a second format according to the configuration information of the template engine, and generating a corresponding entity class object file; and transmitting the second-format report template engine file and the instantiated entity class object file into a template engine for rendering to generate a second-format report, and transmitting different parameters through the instantiated entity class object to generate different reports, so that one-time design and multiple use are realized.

Description

Report generation method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a report.
Background
The report forms are forms, diagrams and other formats used for dynamically displaying data, and the report form templates are fixed-format report forms and are displayed by filling in data.
The table in excel or word can be converted into hypertext Markup Language (HTML) and displayed in a web browser, usually using a programming Language such as python. This conversion is typically one-time, requiring programming using a programming language such as python if the data and format of the table in excel or word changes.
Disclosure of Invention
The embodiment of the application provides a report generation method, a report generation device, report generation equipment and a storage medium.
In a first aspect, an embodiment of the present application provides a report generation method, including: acquiring a first format report template which is custom designed by a user; converting the report template in the first format into a report template engine file in a second format according to configuration information of a template engine, and generating a corresponding entity class object file; and transmitting the second-format report template engine file and the instantiated entity class object file into a template engine for rendering to generate a second-format report.
In a second aspect, an embodiment of the present application provides a report generation apparatus, including: the acquisition module is configured to acquire a first format report template which is custom designed by a user; the format conversion module is configured to convert the first format report template into a second format report template engine file according to the configuration information of the template engine and generate a corresponding entity class object file; and the generating module is configured to transmit the second-format report template engine file and the instantiated entity class object file into a template engine for rendering, so as to generate a second-format report.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
In a fourth aspect, embodiments of the present application propose a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described in any one of the implementations of the first aspect.
According to the report generation method, the report generation device, the report generation equipment and the storage medium, firstly, a first format report template which is designed by a user in a self-defined mode is obtained; then according to the configuration information of the template engine, converting the report template in the first format into a report template engine file in a second format, and generating a corresponding entity class object file; and finally, transmitting the second-format report template engine file and the instantiated entity class object file into a template engine for rendering to generate a second-format report, and transmitting different parameters through the instantiated entity class object to generate different reports, so that one-time design and multiple-time use are realized.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings. The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a report generation method according to the present application;
FIG. 3 is a schematic flow chart diagram illustrating another embodiment of a report generation method according to the present application;
FIG. 4 is a schematic diagram illustrating an application scenario of an embodiment of a report generation method according to the present application;
FIG. 5 shows a user-designed Excel report template;
FIG. 6 shows an original format template file after naming variables in the Excel report template shown in FIG. 5;
FIG. 7 illustrates an HTML template engine file generated after parsing the raw format template file shown in FIG. 6;
FIG. 8 is a diagram illustrating a matching POJO class file generated after parsing the original format template file shown in FIG. 6;
FIG. 9 illustrates an HTML report containing data generated after rendering by a template engine;
fig. 10 is a schematic structural diagram of an embodiment of a report generation apparatus according to the present application;
fig. 11 is a block diagram of an electronic device for implementing a report generation method according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which an embodiment of the report generation method or report generation apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. Network 102 is the medium used to provide communication links between terminal devices 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
Terminal device 101 may interact with server 103 through network 102. The terminal device 101 can provide a report template with a first format designed by a user in a customized way, including but not limited to a database, a user terminal and the like.
The server 103 may provide various services, for example, the server 103 may analyze and process data, such as a report template in a first format, which is custom-designed by a user and acquired from the terminal device 101, and generate a processing result (e.g., generate a report in a second format).
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the report generation method provided in the embodiment of the present application is generally executed by the server 103, and accordingly, the report generation apparatus is generally disposed in the server 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a report generation method according to the present application is shown. The report generation method comprises the following steps:
step 201, a first format report template designed by a user in a self-defined way is obtained.
In this embodiment, an execution subject (for example, the server 103 shown in fig. 1) of the report generation method may obtain a first format report template custom-designed by a user.
The user can design any one first format report template according to the needs. The first format may be a simple and easy-to-use report format frequently used by users, such as Excel report format developed by microsoft corporation, Word report format, etc. The user can set the cells, the titles, the data and the like in the report with the first format at will.
Where the data in the first format report is a variable, the variable may be named. In the example of statistical software development data, the development cycle, the test cycle, and the delivery cycle of software are variables, the data of the development cycle may be named as "{ reportvo.devperiods }", the data of the test cycle may be named as "{ reportvo.testperiods }", and the data of the delivery cycle may be named as "{ reportvo.deliveryperiods }".
After the user designs and completes the report with the first format according to the needs and names the variables in the report with the first format, the variables can be sent to the execution main body through the network 102 in fig. 1.
Step 202, according to the configuration information of the template engine, converting the report template in the first format into a report template engine file in a second format, and generating a corresponding entity class object file.
In this embodiment, the execution main body may convert the report template in the first format into a report template engine file in the second format according to the configuration information of the template engine, and generate the corresponding entity class object file. The second format may be a report format satisfying a specific purpose, such as an HTML report format that can be used for web page display and mail sending.
The template engine is used for separating the user interface from the business data, and can generate a document with a specific format, and the template file and the data generate a standard HTML document through the template engine for the website. The second format report form template engine file is the template file used by the template engine to generate the specific format document. The configuration information of the template engine refers to information that enables the template file to be adapted to the template engine so that a specific format document can be generated. For example, the configuration information of the template engine may include configuration information of the variables, i.e., location information specified by the template engine to place the variables. Illustratively, the variable in the report template in the first format custom-designed by the user includes a development period "{ reportvo.devperiods }, then according to the configuration information of the template engine (for example, the configuration information of the variable), the variable name { reportvo.devperiods } can be added to the corresponding position of the report template engine file in the second format.
The configuration information of the template engine comprises the parameter configuration information when the entity class object class is instantiated. The entity class object file and the second format report form template engine file are generated in a matching way. The variable declaration in the second format report template engine file and the variable declaration in the entity class object file are in one-to-one correspondence. For example, the second format report template engine file contains the variable name { reportVO. devPeriods }, and the matching entity class object file contains the corresponding variable declaration "public class reportVO { … private String devPeriods }". Where an entity class is a class used to model information and related behaviors that must be stored. Entity class objects (instances of entity classes) are used to hold and update information about some phenomena, such as: an event, a person or some real-life object. Entity class Objects include, but are not limited to, Persistent Objects (POs), Value Objects (VOs), simple Java class Objects (POJOs), and the like. Taking the entity class object as the simple Java object class as an example, after a variable in the simple Java object class is assigned, the variable is dynamically loaded into a second format report template engine file and is finally rendered by a template engine.
Step 203, the second format report template engine file and the instantiated entity class object file are transmitted to the template engine for rendering, and a second format report is generated.
In this embodiment, the execution body may transmit the second-format report template engine file and the instantiated entity class object file to the template engine for rendering, so as to generate a second-format report.
And after the variables in the instance are assigned, the variables are transmitted into the template engine to be rendered, and then the report in the second format can be generated. The rendering refers to that the template engine automatically assigns the value of the variable in the template file (for example, the second format report template engine file) to the position of the variable in the template file, and then generates a specific report. By assigning different values to the variables, different reports can be generated.
According to the report generation method provided by the embodiment of the application, the report template in the second format which accords with the specific purpose can be generated by designing the report template in the first format which is simple and easy to use by a user, and the report template can be used for many times by transmitting different data into the report template in the second format, so that the trouble of editing the report template in a code is avoided, the report template is simple and easy to use by the user, and even a person who does not know Java programming can design the report template.
In some optional implementations of this implementation, the step 202 includes: and converting the table in the report template with the first format into a table with a second format by adopting a preset table conversion algorithm.
The table conversion algorithm refers to an algorithm for resolving the first format template into the second format element table. Taking the first format as Excel and the second format as HTML as an example, through a table conversion algorithm, a table element in Excel can be converted into an HTML table element. For example: one line in Excel is converted into one line "< tr > </tr >" in HTML; one cell in Excel, and HTML generated is "< td > </td >"; excel combines two rows, and "rowspan ═ 2" in HTML td; two columns are merged in excel, "colspan ═ 2" where HTML is tr, and so on.
In some optional implementations of this implementation, the step 202 includes: and converting the elements in the table in the report template with the first format into the elements in the table with the second format according to the element configuration information.
The elements refer to information input by a user in the initialized report template in the first format, and comprise a report title, characters in each cell, a cell background color and the like. The element configuration information refers to information used for enabling elements in the first-format report template to be adapted to the calling of the template engine so as to render the template file. Taking the first format as Excel and the second format as HTML as an example, according to the element configuration information, each element in Excel is analyzed from the format set by Excel, and then, an HTML Cascading Style Sheets (CSS) Style is generated. CSS is used to define the style of elements in HTML, such as font size, font color, cell background color, indentation, and the like.
In some optional implementations of this implementation, the step 202 includes: and adding the head and the drop of the report template with the second format to generate a report template engine file with the second format.
The configuration information of the template engine comprises the configuration information of the report template in the second format. And adding the head and the payment of the report template with the second format through the configuration information of the report template with the second format. Taking the second format as HTML as an example, by adding an HTML header and a report drop, a complete HTML template file can be generated. Among them, the HTML header element (< head > element) is a container of all header elements, and may contain a title (title), a script, a style, meta information, and other information.
In some alternative implementations of this implementation, the template engine includes any one of: FreeMarker, Thymelaaf, Velocity, Beetl, Jsp. FreeMarker is a template engine, a generic tool for generating text output based on templates, written in pure Java. FreeMarker is designed to generate HTML Web pages.
Thymeleaf is an XML/XHTML/HTML5 template engine that provides a well-formatted template creation that can be displayed correctly by a browser.
Velocity is a Java-based template engine (template engine). It allows the use of a template language (template language) to reference objects defined by the Java code. When the Velocity is applied to web development, an interface designer can synchronously develop a web site following the MVC architecture with a Java program developer, that is, the page designer can only focus on the display effect of a page, and the Java program developer focuses on business logic coding.
Beetl is an abbreviation for Bee Template Language, another Java Template engine, which can be integrated with various web frameworks, such as Spring MVC, JFinal, Struts, Nutz, Jodd, Servlet, etc.
Jsp (Java Server Page ) technology) is a specification of a Server dynamic Page generation technology made by Sun.
With further reference to FIG. 3, there is shown a flow chart of another embodiment of a report generation method, the method comprising the steps of:
step 301, obtaining a first format report template designed by a user.
Step 302, according to the configuration information of the template engine, converting the report template in the first format into a report template engine file in a second format, and generating a corresponding simple Java object class file.
And 303, transmitting the second-format report template engine file and the instantiated simple Java object class file into a template engine for rendering, and generating a second-format report.
And step 304, displaying the report in the second format to a webpage or sending the report as the text of the mail.
The execution main body can display the report with the second format to a webpage or send the report as the text of an email. The specific purpose of the second format report is webpage display of a browser or mail sending. In the prior art, for example, Excel is converted into html through python and the like and then displayed in a webpage, or the html is attached to a mail text and sent, so that a report in an Excel format can be sent as a mail. However, the content of the Excel needs to be filled in, if a group of data is changed, the data needs to be manually filled again and then sent, and manual filling and sending are performed each time, so that labor is consumed. According to the embodiment of the application, the report in the second format is displayed on the webpage or sent as the text of the mail, so that one-time design and repeated use of one template can be realized, manpower is saved, and the method is convenient and fast.
For ease of understanding, fig. 4 shows an application scenario diagram of an embodiment of a report generation method according to the present application.
As shown in fig. 4, the method includes:
step 401, obtaining an Excel report template custom-designed by a user.
And opening the Excel by a user, and quickly designing the Excel report template required by the user, wherein the file name is reported. The merging cells can be used by users at will, and the titles and data can be placed at will. FIG. 5 shows a user-designed Excel report template.
Next, the user names the variables in the Excel report template. The named Excel report template can be used as an original format template file (namely, an Excel report template designed by a user in a self-defined way) to be subjected to format conversion. FIG. 6 shows the original format template file after naming the variables in the Excel report template shown in FIG. 5.
Step 402, analyzing the Excel report template according to the configuration information of the Thymeleaf template engine to obtain an HTML template engine file and a matched POJO file thereof.
And analyzing the Excel report template into an HTML element table according to a set algorithm. Illustratively, a simple table HTML element is shown below:
Figure BDA0002852599540000091
where tr represents a row and td represents a column.
Meanwhile, each element (such as report title, first column, characters in each cell and the like) in the Excel report template is analyzed from the format set in the Excel to generate an HTML CSS style. FIG. 7 illustrates an HTML template engine file generated after parsing the raw format template file shown in FIG. 6.
And finally, adding the head of the HTML template engine file and the drop of the template, and generating a complete HTML template engine file.
Wherein, the variable declaration in the matched generated POJO file is in one-to-one correspondence with the variable in the template engine file. Fig. 8 shows a supporting POJO class file generated by parsing the original format template file shown in fig. 6. After a variable of the POJO class is assigned, the variable is dynamically loaded into a Thymeleaf template engine file and is finally rendered by a template engine Thymeleaf.
And step 403, transmitting the HTML report template engine file and the POJO class file into a Thymeleaf template engine, instantiating a POJO class and generating the HTML report.
And generating an HTML report by assigning values to variables in the example and then transmitting the variables into a template engine for rendering. The Thymeleaf template engine can be used for multiple times, different variables are transmitted, different HTML reports are generated, and the method is convenient and fast. FIG. 9 illustrates an HTML report containing data generated after rendering by a template engine.
With further reference to fig. 10, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of generating a report, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 10, the report generation apparatus 1000 of the present embodiment may include: an acquisition module 1001, a format conversion module 1002, and a generation module 1003. The obtaining module 1001 is configured to obtain a first format report template designed by a user in a self-defined manner; the format conversion module 1002 is configured to convert the first format report template into a second format report template engine file according to configuration information of a template engine, and generate a corresponding entity class object file; the generating module 1003 is configured to transmit the second format report template engine file and the instantiated entity class object file into a template engine for rendering, so as to generate a second format report.
In this embodiment, in the report generation apparatus 1000: the specific processing of the obtaining module 1001, the format conversion module 1002 and the generating module 1003 and the technical effects thereof can refer to the related descriptions of step 201 and step 203 in the corresponding embodiment of fig. 2, which are not repeated herein.
In some optional implementation manners of this embodiment, the first-format report template is an Excel report template, and the second-format report is a hypertext markup language report.
In some optional implementations of this embodiment, the configuration information of the template engine includes a predetermined table conversion algorithm; the format conversion module is further configured to: and converting the table in the report template with the first format into a table with a second format by adopting a preset table conversion algorithm.
In some optional implementations of this embodiment, the configuration information of the template engine includes element configuration information; the format conversion module is further configured to: and converting the elements in the table in the first format report template into the elements in the table in the second format according to the element configuration information.
In some optional implementations of this embodiment, the configuration information of the template engine includes variable configuration information; the format conversion module is further configured to: and adding the variables in the report template with the first format to corresponding positions in a report template engine file with a second format according to the variable configuration information.
In some optional implementations of this embodiment, the configuration information of the template engine includes configuration information of a report template in a second format; the format conversion module is further configured to: and adding the head and the drop of the report template with the second format to generate a report template engine file with the second format.
In some optional implementations of this embodiment, the format conversion module is further configured to: declaring the variable in the simple Java object class file according to the variable in the report template with the first format.
In some optional implementations of this embodiment, the template engine includes any one of: FreeMarker, Thymelaaf, Velocity, Beetl, Jsp.
In some optional implementations of this embodiment, the apparatus further includes: and the display module is configured to display the report in the second format to the body of a webpage or an email.
Fig. 11 is a block diagram of an electronic device according to a report generation method in an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 11, the electronic apparatus includes: one or more processors 1101, a memory 1102, and interfaces for connecting the various components, including a high speed interface and a low speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 11, a processor 1101 is taken as an example.
The memory 1102 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor, so that the at least one processor executes the report generation method provided by the application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the report generation method provided by the present application.
The memory 1102, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the report generation method in the embodiment of the present application (for example, the obtaining module 1001, the format conversion module 1002, and the generation module 1003 shown in fig. 1000). The processor 1101 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 1102, that is, implements the report generation method in the above method embodiment.
The memory 1102 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device of the generation method of the report, and the like. Further, the memory 1102 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1102 optionally includes a memory remotely located from the processor 1101, and these remote memories may be connected to the electronic device of the report generation method through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the report generation method may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected by a bus or other means, and are exemplified by being connected by a bus in fig. 11.
The input device 1103 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the report generation method, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer, one or more mouse buttons, a track ball, a joystick, etc. The output devices 1104 may include a display device, auxiliary lighting devices (e.g., LEDs), tactile feedback devices (e.g., vibrating motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the application, firstly, a first format report form template which is custom designed by a user is obtained; then according to the configuration information of the template engine, converting the report template in the first format into a report template engine file in a second format, and generating a corresponding entity class object file; and finally, transmitting the second-format report template engine file and the instantiated entity class object file into a template engine for rendering to generate a second-format report, and transmitting different parameters through the instantiated entity class object to generate different reports, so that one-time design and multiple-time use are realized.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A report generation method comprises the following steps:
acquiring a first format report template which is custom designed by a user;
converting the report template in the first format into a report template engine file in a second format according to configuration information of a template engine, and generating a corresponding entity class object file;
and transmitting the second-format report template engine file and the instantiated entity class object file into a template engine for rendering to generate a second-format report.
2. The method according to claim 1, wherein the first format report template is an Excel report template, the second format report is a hypertext markup language report, and the entity class object file is a simple Java entity class object file.
3. The method of claim 1 or 2, wherein the configuration information of the template engine comprises a predetermined table conversion algorithm;
the converting the report template in the first format into a report template file in a second format according to the configuration information of the template engine comprises the following steps:
and converting the table in the report template with the first format into a table with a second format by adopting a preset table conversion algorithm.
4. The method of claim 3, wherein the configuration information of the template engine comprises element configuration information;
the converting the report template in the first format into a report template file in a second format according to the configuration information of the template engine comprises the following steps:
and converting the elements in the table in the first format report template into the elements in the table in the second format according to the element configuration information.
5. The method of claim 3 or 4, wherein the configuration information of the template engine comprises variable configuration information;
the converting the report template in the first format into a report template file in a second format according to the configuration information of the template engine comprises the following steps:
and adding the variables in the report template with the first format to corresponding positions in a report template engine file with a second format according to the variable configuration information.
6. The method of claim 5, wherein the configuration information of the template engine comprises configuration information of a second format reporting template;
the converting the report template in the first format into a report template file in a second format according to the configuration information of the template engine comprises the following steps:
and adding the head and the drop of the report template with the second format to generate a report template engine file with the second format.
7. The method of claim 5, wherein generating the corresponding simple Java object class file according to the configuration information of the template engine comprises:
declaring the variable in the simple Java object class file according to the variable in the report template with the first format.
8. The method of claim 1, the template engine comprising any of:
FreeMarker、Thymeleaf、Velocity、Beetl、Jsp。
9. the method according to any one of claims 1-8, further comprising:
and displaying the report in the second format to a webpage or sending the report as the text of the mail.
10. An apparatus for generating a report, the apparatus comprising:
the acquisition module is configured to acquire a first format report template which is custom designed by a user;
the format conversion module is configured to convert the first format report template into a second format report template engine file according to the configuration information of the template engine and generate a corresponding entity class object file;
and the generating module is configured to transmit the second-format report template engine file and the instantiated entity class object file into a template engine for rendering, so as to generate a second-format report.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
CN202011533435.4A 2020-12-23 2020-12-23 Report generation method, device, equipment and storage medium Pending CN113822033A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011533435.4A CN113822033A (en) 2020-12-23 2020-12-23 Report generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011533435.4A CN113822033A (en) 2020-12-23 2020-12-23 Report generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113822033A true CN113822033A (en) 2021-12-21

Family

ID=78924900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011533435.4A Pending CN113822033A (en) 2020-12-23 2020-12-23 Report generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113822033A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617819A (en) * 2022-12-19 2023-01-17 思创数码科技股份有限公司 Data storage method, system, computer device and storage medium
CN117252180A (en) * 2023-11-16 2023-12-19 太平金融科技服务(上海)有限公司 Report generation method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070250764A1 (en) * 2006-04-20 2007-10-25 Oracle International Corporation Using a spreadsheet engine as a server-side calculation model
CN102830947A (en) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 Report printing control implemented based on report printing template format
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN110474836A (en) * 2019-08-16 2019-11-19 深圳乐信软件技术有限公司 A kind of email template generation method, calculates equipment and medium at device
CN111177234A (en) * 2018-11-09 2020-05-19 西安智盛锐芯半导体科技有限公司 Device and method for rapidly processing document type data file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070250764A1 (en) * 2006-04-20 2007-10-25 Oracle International Corporation Using a spreadsheet engine as a server-side calculation model
CN102830947A (en) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 Report printing control implemented based on report printing template format
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN111177234A (en) * 2018-11-09 2020-05-19 西安智盛锐芯半导体科技有限公司 Device and method for rapidly processing document type data file
CN110474836A (en) * 2019-08-16 2019-11-19 深圳乐信软件技术有限公司 A kind of email template generation method, calculates equipment and medium at device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617819A (en) * 2022-12-19 2023-01-17 思创数码科技股份有限公司 Data storage method, system, computer device and storage medium
CN117252180A (en) * 2023-11-16 2023-12-19 太平金融科技服务(上海)有限公司 Report generation method and device, electronic equipment and storage medium
CN117252180B (en) * 2023-11-16 2024-02-23 太平金融科技服务(上海)有限公司 Report generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109062567B (en) B/S structure-based information management system rapid development platform
US8972854B2 (en) Graphical creation of a document conversion template
CN107608747B (en) Form system construction method and device, electronic equipment and storage medium
US9817811B2 (en) Web server system, dictionary system, dictionary call method, screen control display method, and demonstration application generation method
CN113822033A (en) Report generation method, device, equipment and storage medium
CN112148871A (en) Abstract generation method and device, electronic equipment and storage medium
CN111159220A (en) Method and apparatus for outputting structured query statement
US20150106928A1 (en) Screening of email templates in campaign management
CN108170409B (en) Development method and system of WEB front-end control
CN110704394B (en) Report configuration modification method and device
CN112416349A (en) Form page generation method, system, equipment and storage medium
CN114003843A (en) Page generation method, device, equipment and storage medium
CN104008042A (en) UI (user interface) automated testing method, system and device
CN111914528B (en) Content editing method, method for generating editor, device, equipment and medium thereof
CN110308907B (en) Data conversion method and device, storage medium and electronic equipment
CN111125597A (en) Webpage loading method, browser, electronic equipment and storage medium
Tanci et al. Software design and code generation for the engineering graphical user interface of the ASTRI SST-2M prototype for the Cherenkov Telescope Array
CN114356291A (en) Method, device, equipment and medium for generating form based on configuration file
CN113419711A (en) Page guiding method and device, electronic equipment and storage medium
CN113342450A (en) Page processing method and device, electronic equipment and computer readable medium
CN112199335A (en) Generation method and generation system of operation log
Karna Enhanced AutoCAD grading application: back-end component
CN112989770B (en) Form generation method, device and system, electronic equipment and storage medium
CN111913703A (en) Object editing method and device, electronic equipment and readable storage medium
CN112540803B (en) Form design adaptation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination