Report generation method, device, computer equipment and storage medium
By combining dynamic column selection and filtering parameters, flexible reports are generated, which solves the problems of resource waste and inflexibility in traditional report design, and achieves efficient resource utilization and simplified development.
Patent Information
- Application Number
- CN202010603806.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-06-29
AI Technical Summary
Traditional report design methods lead to fixed report columns, resulting in waste of resources and inflexibility, and being unable to adapt to the needs of different compensation plans.
Select fields of the form data table in the database through the dynamic column selection instruction, generate a dynamic column form, and extract data based on filtering parameters and report dynamic column information to generate a report, avoiding designing all possible columns in advance.
It improves the utilization rate of report space resource, flexibly adapts to the needs of different compensation plans, saves report storage space, and simplifies development complexity.
Smart Images

Figure CN111881660B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a report generation method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of computer technology, various reports are widely used in the salary systems of companies and enterprises. Different companies and enterprises have different salary plans, and reports for different salary plans have different columns. How to design reports so that they can adapt to different salary plans is an urgent problem that needs to be solved.
[0003] The traditional method uses the exhaustive method to design reports. The exhaustive method is to design the columns in the reports of different salary plans, and then display the required columns and hide the unnecessary columns in different salary plans. However, when designing reports using the above method, since the number of columns in the report is pre-designed, it may cause redundant and useless columns in the report, resulting in a waste of report space resources. Summary of the invention
[0004] Based on this, it is necessary to provide a report generation method, device, computer equipment and storage medium that can improve the utilization rate of report space resources in response to the above technical problems.
[0005] A report generation method, the method comprising:
[0006] Select fields in the form data table in the database according to the input form dynamic column selection instruction;
[0007] Generate a form including at least one dynamic column using the field, and display the form in a form interface; obtain data input in the dynamic column of the form;
[0008] The data inputted in the dynamic column of the form is saved in the form data table to obtain the form data table having the data;
[0009] When a report needs to be generated, obtain the filter parameters and report dynamic column information;
[0010] In the form data table having the data, data is extracted according to the filter parameters and the report dynamic column information, and a report is generated according to the extracted data.
[0011] In one embodiment, the method further comprises:
[0012] Determining a project plan, wherein the project plan includes at least one project;
[0013] Read the projects in the project plan in sequence, and generate fields of the form data table according to the read projects;
[0014] If all the projects in the project plan are read, a form data table is created according to the generated fields.
[0015] In one embodiment, the method further comprises:
[0016] generating a name of the field according to the project identifier;
[0017] The table name of the form data table is generated according to the project solution identifier.
[0018] In one embodiment, the method further comprises:
[0019] Before selecting a field in a form data table in a database according to the input form dynamic column selection instruction, the method further includes:
[0020] When a form view instruction is detected, the form dynamic column selection interface is displayed;
[0021] The form dynamic column selection instruction triggered in the form dynamic column selection interface is obtained.
[0022] In one embodiment, extracting data from the form data table having the data according to the filter parameters and the report dynamic column information, and generating a report according to the extracted data includes:
[0023] Get the report statement file;
[0024] Parsing the report statement file to obtain a report generation statement;
[0025] The report generation statement is executed to extract data in a field corresponding to the dynamic column information of the report from a form data table having the data, and the data in the field is processed according to the filter parameters to obtain the report.
[0026] In one embodiment, generating a report based on the extracted data includes:
[0027] Extract the header information from the report statement file;
[0028] Determine whether the header information includes a dynamic column flag and a double header flag;
[0029] If the header information includes the dynamic column flag and the double header flag, generating a header column set according to the header information, the dynamic column flag and the double header flag;
[0030] A report is generated according to the header column set and the extracted data.
[0031] In one embodiment, the method further comprises:
[0032] If the header information does not include the dynamic column flag and the double header flag, generating a header column according to the header information;
[0033] A report is generated based on the header columns and the extracted data.
[0034] A report generation device, comprising:
[0035] The selection module is used to select fields in the form data table in the database according to the input form dynamic column selection instruction;
[0036] A generating module, used to generate a form including at least one dynamic column by using the fields, and display the form in a form interface;
[0037] An acquisition module, used for acquiring data input in a dynamic column of the form;
[0038] A saving module, used for saving the data inputted in the dynamic column of the form in the form data table, and obtaining the form data table having the data;
[0039] The acquisition module is also used to acquire filtering parameters and report dynamic column information when a report needs to be generated;
[0040] The generating module is used to extract data from the form data table having the data according to the filtering parameters and the dynamic column information of the report, and generate a report according to the extracted data.
[0041] In one embodiment, the apparatus further comprises:
[0042] A determination module, used to determine a project plan, wherein the project plan includes at least one project;
[0043] The generating module is further used to read the projects in the project plan in sequence, and generate fields of the form data table according to the read projects;
[0044] The creation module is used to create a form data table according to the generated fields if all the projects in the project plan are read.
[0045] In one embodiment, the apparatus further comprises:
[0046] The generating module is further used to generate the name of the field according to the project identifier; and to generate the table name of the form data table according to the project solution identifier.
[0047] In one embodiment, the apparatus further comprises:
[0048] The display module is used to display the dynamic column selection interface of the form when the form view instruction is detected;
[0049] The acquisition module is used to acquire the form dynamic column selection instruction triggered in the form dynamic column selection interface.
[0050] In one embodiment, the generating module is further used for:
[0051] Get the report statement file;
[0052] Parsing the report statement file to obtain a report generation statement;
[0053] The report generation statement is executed to extract data in a field corresponding to the dynamic column information of the report from a form data table having the data, and the data in the field is processed according to the filter parameters to obtain the report.
[0054] In one embodiment, the generating module is further used for:
[0055] Extract the header information from the report statement file;
[0056] Determine whether the header information includes a dynamic column flag and a double header flag;
[0057] If the header information includes the dynamic column flag and the double header flag, generating a header column set according to the header information, the dynamic column flag and the double header flag;
[0058] A report is generated according to the header column set and the extracted data.
[0059] In one embodiment, the apparatus further comprises:
[0060] The generating module is further used to generate a header column according to the header information if the header information does not contain the dynamic column flag and the double header flag; and to generate a report according to the header column and the extracted data.
[0061] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that the processor implements the steps of the parameter optimization method of the cable intermediate joint when executing the computer program.
[0062] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the parameter optimization method of the cable intermediate joint are implemented.
[0063] In the above embodiment, when generating a report, the computer device generates a report using the data in the form according to the filtering parameters and report dynamic column information obtained from the user instruction. Since different user instructions contain different filtering parameters and report dynamic column information, the computer device can generate reports with different dynamic columns according to different user instructions, without having to design all possible columns in the report in advance and store them in the database, thereby saving report storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1a An application environment diagram of a report generation method in an embodiment;
[0065] Figure 1b A flowchart of a report generation method in one embodiment;
[0066] Figure 2 A timing diagram for generating a form in one embodiment;
[0067] Figure 3 It is a flowchart of a report generation method in another embodiment;
[0068] Figure 4 A timing diagram for generating a report in one embodiment;
[0069] Figure 5 is a structural block diagram of a report generating device in one embodiment;
[0070] Figure 6 It is a structural block diagram of a report generating device in another embodiment;
[0071] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0073] The report generation method provided in this application can be applied to Figure 1aIn the application environment shown. The terminal 102 communicates with the server 104 through a network. The report generation method can be applied to the terminal 102 or the server 104. When the report generation method is applied to the server 104, the server 104 first determines the dynamic columns in the form according to the instructions of the form dynamic column selection instruction, selects the fields corresponding to the dynamic columns of the form in the form data table of the database, generates a form according to the selected fields, and then displays the form on the terminal 102. Then, the server 104 obtains the data input by the terminal 102 in the dynamic column of the form, and stores it in the corresponding form data table. Finally, when it is necessary to generate a report, the server 104 extracts the data in the form data table according to the obtained filtering parameters and the report dynamic column information and generates a report, and then displays the report on the terminal 102.
[0074] When the report generation method is applied to the terminal 102, the terminal 102 first determines the dynamic columns in the form according to the instructions of the form dynamic column selection instruction, selects the fields corresponding to the dynamic columns of the form in the form data table of the database, and generates and displays the form according to the selected fields. Then, the terminal 102 obtains the data entered in the dynamic columns of the form and stores them in the corresponding form data table. Finally, when it is necessary to generate a report, the terminal 102 extracts the data in the form data table according to the obtained filtering parameters and the report dynamic column information and generates a report, and then displays the report.
[0075] The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0076] In one embodiment, Figure 1b As shown, a report generation method is provided, which is applied to Figure 1a Taking the server 104 in the example as an example, the following steps are included:
[0077] S102: selecting fields in a form data table in a database according to the input form dynamic column selection instruction.
[0078] Among them, a form is a form displayed to the user on the display interface, which is used to display or collect data to the user. According to different user needs, the server needs to display forms with different dynamic columns to the user for the user to view and enter data. For example, for a form of a salary system, different salary items are displayed in the dynamic columns of the form. For example, the dynamic column can display salary items such as basic salary, performance, night shift allowance, transportation allowance, project rewards, etc. The data in the dynamic columns of the form are stored in the fields of the corresponding form data table in the database.
[0079] The form dynamic column selection instruction is used to instruct the server which dynamic columns in the form to display to the user. According to the instruction of the form dynamic column selection instruction, the server selects the fields corresponding to the dynamic columns selected by the form dynamic column selection instruction in the form data table of the database. For example, the form dynamic column selection instruction instructs the server to display the basic salary, transportation subsidy, and night shift allowance dynamic columns for January in the form, then the server selects the basic salary field, transportation subsidy field, and night shift allowance field in the form data table according to the instruction.
[0080] S104: Generate a form including at least one dynamic column using the fields, and display the form in a form interface.
[0081] After selecting a field in the form data table, the server obtains the field name and data type of the selected field. Then, the corresponding form is generated according to the field name and data type of the field, and displayed to the user in the form interface. If the field in the form data table selected by the server stores data, the data in the field is displayed in the dynamic column of the form. The user can view the data in the form through the form displayed in the form interface, or edit the data.
[0082] S106, acquiring data input in the dynamic column of the form.
[0083] After the server displays the form to the user, it obtains the data entered by the user in the dynamic column of the form according to the user's editing instruction. The server supports the user to enter the editing instruction in text form, or in voice or other forms.
[0084] S108, saving the data input into the dynamic column of the form in the form data table, and obtaining the form data table having the data.
[0085] After the server obtains the data entered by the user in the dynamic column of the form, it saves the obtained data in the form data table corresponding to the form. The form data table stores the data collected from the user. When the server detects the user's instruction to view the form, it generates a form based on the user's instruction and uses the data in the form data table to display it to the user.
[0086] S110, when a report needs to be generated, filter parameters and report dynamic column information are obtained.
[0087] The report is a table generated based on the calculated data after the data in the form is calculated. The server displays the results of analyzing and summarizing the data in the form to the user in the report.
[0088] The filter parameter is a condition for filtering the data for generating the report, and determines the scope of filtering the data for generating the report. For example, if the filter parameter is department X, the server will filter out all the data of department X according to this filter parameter. For example, if the filter parameter is January to June, the server will filter out all the data from January to June according to this filter parameter.
[0089] The report dynamic column information is information indicating which dynamic columns are included in the report, and is used to instruct the server how to select fields in the form data table that correspond to the dynamic columns of the report. For example, the report dynamic column information can be the sum of basic salary and night shift allowance, and the growth rate of performance compared with the same period last year. The server selects data in the fields corresponding to basic salary, night shift allowance, and performance in the form data table according to the report dynamic column information, and performs calculations based on the selected data to generate a report containing dynamic columns of the sum of basic salary, night shift allowance, and the growth rate of performance compared with the same period last year.
[0090] S112: extracting data from the form data table having the data according to the filter parameters and the report dynamic column information, and generating a report according to the extracted data.
[0091] In one embodiment, the server extracts data from a form data table having data according to filter parameters and report dynamic column information, and generates a report based on the extracted data, including: determining a field corresponding to the report dynamic column information in the form data table having data; processing the data corresponding to the field according to the filter parameters to obtain a report.
[0092] After the server selects the data of the corresponding field in the form data table according to the dynamic column information of the report, it filters the data in the field according to the filter parameters, and performs operations on the filtered data to obtain a report.
[0093] For example, when the server displays the basic salary, night shift allowance, and performance growth rate of employees above level 3 in department X from January to June in a report according to the instructions entered by the user, the server first extracts the data of the corresponding fields of basic salary, night shift allowance, and performance in the form data table according to the dynamic column information of the report. Then, the data of the corresponding fields of employees above level 3 in department X from January to June are filtered out according to the filter parameters. After extracting the data from the form data table, the server performs a sum operation on the data of the night shift allowance field, calculates the growth rate operation on the data of the performance field, and generates a report based on the calculated data to display to the user.
[0094] In the above embodiment, when generating a report, the server generates a report using the data in the form according to the filtering parameters and report dynamic column information obtained from the user instruction. Since different user instructions contain different report dynamic column information, the server can generate reports with different dynamic columns according to different user instructions, without having to design all possible columns in the report in advance and store them in the database, thereby saving report storage space.
[0095] In one embodiment, the server dynamically generates a form data table with a variable number of columns according to a project plan. The server determines a project plan, which includes at least one project; reads the projects in the project plan in sequence, and generates fields of the form data table according to the read projects; if all the projects in the project plan are read, the form data table is created according to the generated fields.
[0096] Among them, different projects are set in the project plan. For example, for the salary system, the project plan includes: basic salary, overtime allowance, performance, project bonus, etc. The projects in the project plan are displayed in the form as dynamic columns in the form and stored in the form data table as fields in the data table.
[0097] In one embodiment, the server generates the name of the field according to the project identifier and generates the table name of the form data table according to the project scheme identifier. For example, the name of the field in the form data table generated by the server is the same as the project identifier, and the table name of the generated form data table is the same as the project scheme identifier.
[0098] The server cyclically reads the project creation form data table in the project plan, and creates form data tables with different fields according to different project plans. The number of fields in the form data table generated by the server can be determined by the number of projects in the project plan, and the fields in the form data table are not limited by the number of columns. Since the server generates forms and reports based on the fields in the form data table, when the fields in the form data table can be dynamically generated according to the project plan, the dynamic columns in the forms and reports can also be dynamically generated according to the project plan. The forms and reports dynamically generated according to the project plan have a flexible framework that can adapt to the needs of various project plans. Since there is no need to design forms and reports that include dynamic columns corresponding to the projects in all project plans in advance, the complexity of form and report development is reduced, making the development of forms and reports faster and avoiding wasting storage space.
[0099] In one embodiment, before the server selects fields in the form data table in the database according to the input form dynamic column selection instruction, it also includes: when a view form instruction is detected, displaying a form dynamic column selection interface; obtaining the form dynamic column selection instruction triggered in the form dynamic column selection interface.
[0100] The server supports the form dynamic column selection instruction triggered by a click, or the server may also support the form dynamic column selection instruction triggered by a voice signal, or the form dynamic column selection instruction triggered by other forms.
[0101] In one embodiment, the process of the server generating and displaying the form to the user is as follows: Figure 2 As shown:
[0102] S202, obtaining a form viewing instruction.
[0103] S204, displaying the form dynamic column selection interface.
[0104] S206, obtaining a form dynamic column selection instruction.
[0105] S208, selecting fields according to the form dynamic column selection instruction.
[0106] S210, generating a form.
[0107] S212, displaying the form in the form interface.
[0108] For the specific contents of S202 to S212 above, reference may be made to the specific implementation process described above.
[0109] In one embodiment, the server extracts data from a form data table having data according to filter parameters and report dynamic column information, and generates a report according to the extracted data, including: obtaining a report statement file; parsing the report statement file to obtain a report generation statement; executing the report generation statement to extract data in a field corresponding to the report dynamic column information in the form data table having data, and processing the data in the field according to the filter parameters to obtain a report.
[0110] The report statement file defines the report statements, and the server parses the report statements in the report statement file to obtain report generation statements, which include statements for selecting data and statements for operating on data to generate reports.
[0111] In one embodiment, the process of parsing a report statement file by a computer device includes: (1) checking whether a custom loop function is used in the report statement, obtaining the loop variable of the loop function and the loop statement to be executed. Replacing the loop variable with the report dynamic column information, and setting the loop statement to be executed under the conditions represented by the report dynamic column information. (2) Replacing the filter parameter variable in the report statement with the filter parameter. (3) Replacing the table name variable in the report statement with the table name of the created report.
[0112] In one embodiment, the report statement file is a file in XML (Extensible Markup Language) format. XML is a markup language used to mark electronic files to make them structured, which can be used to mark data and define data types. It is a source language that allows users to define their own markup languages.
[0113] In one embodiment, the report statements are written in SQL (Structured Query Language). SQL is a database query and programming language used to access data and query, update and manage relational database systems. SQL does not require users to specify the storage method for data, nor does it require users to understand the specific data storage method, so different database systems with completely different underlying structures.
[0114] In one embodiment, the report statement file uses <fields>Define report title information; use<fieldvariable="@FieldItem@" / > Describes dynamic columns, or is used to describe whether the report header supports double header display; <sql>Define the loop statement for report execution.
[0115] The server executes the report generation statement. By executing the report generation statement, the data in the field corresponding to the dynamic column information of the report in the form data table is extracted, and the data in the field is filtered according to the filter parameters, and the data that meets the conditions is selected, and the filtered data is calculated to obtain the report.
[0116] The server defines the report statement in the report statement file, which separates the report statement from the report design process, making it easier to edit and modify the report statement, and also easier to develop and maintain the report. And because variables are used in the report statement to represent the filter parameters and dynamic column information of the report, when actually generating the report, the server can replace the variables in the report statement with the obtained filter parameters and dynamic column information to obtain the report generation statement, and can generate different reports by executing the report generation statement to extract and process the data, simplifying the report design process.
[0117] In one embodiment, the server generates a report based on the extracted data, including: extracting header information in the report statement file; determining whether the header information contains dynamic column flags and double header flags; if the header information contains dynamic column flags and double header flags, generating a header column set based on the header information, dynamic column flags and double header flags; and generating a report based on the header column set and the extracted data.
[0118] Since the header in the report can also be displayed in the form of dynamic columns, the server determines whether the report header is displayed in the form of dynamic columns based on the header information in the report statement file. If the header information contains the dynamic column flag and the double header flag, it means that the report header is displayed in the form of dynamic columns. The server generates a header column set based on the header information, the dynamic column flag and the double header flag, and generates a report based on the header column set and the extracted data to display to the user.
[0119] In one embodiment, if the header information does not include a dynamic column flag and a double header flag, the server generates a header column according to the header information; and generates a report according to the header column and the extracted data.
[0120] If the header information does not contain the dynamic column flag and the double header flag, it means that the report has a fixed header and is not displayed in a dynamic column manner. The server generates a header column based on the header information, and generates a report based on the header column and the extracted data to display to the user.
[0121] The server sets the header information in the report statement file and dynamically generates the report header according to the report type, making the report header design more convenient and simple to meet the needs of different reports.
[0122] In one embodiment, the process of generating a report by the server is as follows: Figure 3 As shown, the following steps are included:
[0123] S302, create a new report.
[0124] S304, displaying an interface for obtaining dynamic column information and filtering parameters.
[0125] S306, obtaining dynamic column information and filtering parameters.
[0126] S308, obtaining a report statement file.
[0127] S310, replacing loop variables with report dynamic column information, and setting the loop statement to be executed under the condition represented by the report dynamic column information.
[0128] S312, replacing the filter parameter variable in the report statement with the filter parameter to obtain a report generation statement.
[0129] S314, executing the report generation statement to generate a report.
[0130] S316, display report.
[0131] For the specific contents of S302 to S316 above, reference may be made to the specific implementation process described above.
[0132] In one embodiment, the computer device generates and displays a form, and generates a report based on the data in the form data table. Figure 4 As shown, the following steps are included:
[0133] S402, obtaining a project plan selection instruction.
[0134] S404, creating a form data table.
[0135] S406, storing the form data table in a database.
[0136] S408, obtaining a form dynamic column selection instruction.
[0137] S410, selecting a field in the form data table.
[0138] S412, generating a form using the fields in the form data table.
[0139] S414, displaying the form in the form interface.
[0140] S416, obtaining data input into the dynamic column of the form.
[0141] S418, saving the data entered in the dynamic column of the form in the form data table.
[0142] S420: Obtain filter parameters and report dynamic column information.
[0143] S422, obtaining a report statement file and parsing the report statement file to obtain a report generation statement
[0144] S424, executing the report generation statement to extract data in the fields corresponding to the dynamic column information of the report in the form data table
[0145] S426, executing a report generation statement, and generating a report according to the data in the extracted form data table.
[0146] S428, display report.
[0147] For the specific contents of S402 to S428 above, reference may be made to the specific implementation process described above.
[0148] It should be understood that although Figure 1b-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1b-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0149] In one embodiment, Figure 5 As shown, a report generation device is provided, including: a selection module 502, a generation module 504, an acquisition module 506 and a storage module 508, wherein:
[0150] A selection module 502 is used to select fields in a form data table in a database according to an input form dynamic column selection instruction;
[0151] A generating module 504, configured to generate a form including at least one dynamic column using the fields, and display the form in a form interface;
[0152] The acquisition module 506 is used to acquire the data input in the dynamic column of the form;
[0153] A saving module 508 is used to save the data input in the dynamic column of the form in the form data table to obtain the form data table with the data;
[0154] The acquisition module 502 is also used to acquire filtering parameters and report dynamic column information when a report needs to be generated;
[0155] The generating module 504 is used to extract data from the form data table having data according to the filtering parameters and the dynamic column information of the report, and generate a report according to the extracted data.
[0156] In the above embodiment, when generating a report, the computer device generates a report using the data in the form according to the filtering parameters and report dynamic column information obtained from the user instruction. Since different user instructions contain different filtering parameters and report dynamic column information, the computer device can generate reports with different dynamic columns according to different user instructions, without having to design all possible columns in the report in advance and store them in the database, thereby saving report storage space.
[0157] In one embodiment, Figure 6 As shown, the device also includes:
[0158] A determination module 510 is used to determine a project plan, wherein the project plan includes at least one project;
[0159] The generating module 504 is further used to read the projects in the project plan in sequence, and generate fields of the form data table according to the read projects;
[0160] The creation module 512 is used to create a form data table according to the generated fields if all the projects in the project plan are read.
[0161] In one embodiment, the apparatus further comprises:
[0162] The generating module 504 is further used to generate the name of the field according to the project identifier; and generate the table name of the form data table according to the project solution identifier.
[0163] In one embodiment, the apparatus further comprises:
[0164] The display module 514 is used to display the form dynamic column selection interface when a form viewing instruction is detected;
[0165] The acquisition module 506 is used to acquire the form dynamic column selection instruction triggered in the form dynamic column selection interface.
[0166] In one embodiment, the generating module 504 is further configured to:
[0167] Get the report statement file;
[0168] Parse the report statement file to obtain the report generation statement;
[0169] The report generation statement is executed to extract data in the fields corresponding to the dynamic column information of the report from the form data table having data, and the data in the fields is processed according to the filter parameters to obtain the report.
[0170] In one embodiment, the generating module 504 is further configured to:
[0171] Extract the header information from the report statement file;
[0172] Determine whether the table header information contains a dynamic column flag and a double table header flag;
[0173] If the header information contains a dynamic column flag and a double header flag, a header column set is generated according to the header information, the dynamic column flag and the double header flag;
[0174] Generate a report based on the header column set and the extracted data.
[0175] In one embodiment, the apparatus further comprises:
[0176] The generating module 504 is further used to generate a header column according to the header information if the header information does not contain a dynamic column flag and a double header flag; and to generate a report according to the header column and the extracted data.
[0177] The specific definition of the report generation device can be found in the definition of the report generation method above, which will not be repeated here. Each module in the above report generation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0178] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. The terminal is used as an example for explanation. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store report generation data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a report generation method is implemented.
[0179] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0180] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: selecting a field in a form data table in a database according to an input form dynamic column selection instruction; generating a form including at least one dynamic column using the field, and displaying the form in a form interface; obtaining data input in the dynamic column of the form; saving the data input in the dynamic column of the form in a form data table to obtain a form data table having data; when a report needs to be generated, obtaining filter parameters and report dynamic column information; extracting data from the form data table having data according to the filter parameters and the report dynamic column information, and generating a report based on the extracted data.
[0181] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a project plan, which includes at least one project; reading the projects in the project plan in sequence, and generating fields of a form data table based on the read projects; if all the projects in the project plan are read, creating a form data table based on the generated fields.
[0182] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating a name of a field according to the project identifier; generating a table name of a form data table according to the project solution identifier.
[0183] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when a form viewing instruction is detected, a form dynamic column selection interface is displayed; and a form dynamic column selection instruction triggered in the form dynamic column selection interface is obtained.
[0184] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a report statement file; parsing the report statement file to obtain a report generation statement; executing the report generation statement to extract data in a field corresponding to the dynamic column information of the report in a form data table having data, and processing the data in the field according to the filter parameters to obtain a report.
[0185] In one embodiment, when the processor executes the computer program, the following steps are also implemented: extracting the header information in the report statement file; determining whether the header information contains a dynamic column flag and a double header flag; if the header information contains a dynamic column flag and a double header flag, generating a header column set according to the header information, the dynamic column flag and the double header flag; and generating a report according to the header column set and the extracted data.
[0186] In one embodiment, when the processor executes the computer program, the following steps are further implemented: if the header information does not contain a dynamic column flag and a double header flag, a header column is generated according to the header information; and a report is generated according to the header column and the extracted data.
[0187] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: selecting fields in a form data table in a database according to an input form dynamic column selection instruction; using the fields to generate a form including at least one dynamic column, and displaying the form in a form interface; obtaining data input in the dynamic column of the form; saving the data input in the dynamic column of the form in a form data table to obtain a form data table with data; when it is necessary to generate a report, obtaining filter parameters and report dynamic column information; in the form data table with data, extracting data according to the filter parameters and report dynamic column information, and generating a report based on the extracted data.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining a project plan, which includes at least one project; reading the projects in the project plan in sequence, and generating fields of a form data table based on the read projects; if all the projects in the project plan are read, creating a form data table based on the generated fields.
[0189] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a name of a field according to the project identifier; generating a table name of a form data table according to the project solution identifier.
[0190] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when a form viewing instruction is detected, a form dynamic column selection interface is displayed; and a form dynamic column selection instruction triggered in the form dynamic column selection interface is obtained.
[0191] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a report statement file; parsing the report statement file to obtain a report generation statement; executing the report generation statement to extract data in a field corresponding to the dynamic column information of the report in a form data table having data, and processing the data in the field according to the filter parameters to obtain a report.
[0192] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting the header information in the report statement file; determining whether the header information contains dynamic column flags and double header flags; if the header information contains dynamic column flags and double header flags, generating a header column set according to the header information, the dynamic column flags and the double header flags; and generating a report according to the header column set and the extracted data.
[0193] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the header information does not contain a dynamic column flag and a double header flag, a header column is generated according to the header information; and a report is generated according to the header column and the extracted data.
[0194] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0195] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.< / sql> < / fields>
Claims
1. A report generation method, characterized in that: The method comprises: Selecting fields in the form data table in the database according to the input form dynamic column selection instruction; the form dynamic column selection instruction is used to instruct the server which dynamic columns in the form to display to the user; Generating a form including at least one dynamic column using the fields, and displaying the form in a form interface; Get the data entered in the dynamic column of the form; The data inputted in the dynamic column of the form is saved in the form data table to obtain the form data table having the data; When a report needs to be generated, filter parameters and report dynamic column information are obtained from user instructions; the filter parameters and report dynamic column information are represented by variables; Acquire a report statement file; parse the report statement file to obtain a report generation statement; execute the report generation statement to extract data in a field corresponding to the dynamic column information of the report in a form data table having the data, and process the data in the field according to the filter parameters to obtain the report.
2. The method according to claim 1, characterized in that The method comprises: Determining a project plan, wherein the project plan includes at least one project; Read the projects in the project plan in sequence, and generate fields of the form data table according to the read projects; If all the projects in the project plan are read, a form data table is created according to the generated fields.
3. The method according to claim 2, characterized in that The method further comprises: generating a name of the field according to the project identifier; The table name of the form data table is generated according to the project solution identifier.
4. The method according to claim 1, characterized in that: Before selecting a field in a form data table in a database according to the input form dynamic column selection instruction, the method further includes: When a form view instruction is detected, the form dynamic column selection interface is displayed; The form dynamic column selection instruction triggered in the form dynamic column selection interface is obtained.
5. The method according to any one of claims 1 to 4, characterized in that: Generating a report based on the extracted data includes: Extract the header information from the report statement file; Determine whether the header information includes a dynamic column flag and a double header flag; If the header information includes the dynamic column flag and the double header flag, generating a header column set according to the header information, the dynamic column flag and the double header flag; A report is generated according to the header column set and the extracted data.
6. The method according to claim 5, characterized in that The method further comprises: If the header information does not include the dynamic column flag and the double header flag, generating a header column according to the header information; A report is generated based on the header columns and the extracted data.
7. A report generation device, characterized in that: The device comprises: A selection module is used to select fields in a form data table in a database according to an input form dynamic column selection instruction; the form dynamic column selection instruction is used to instruct the server which dynamic columns in the form to display to the user; A generating module, used to generate a form including at least one dynamic column by using the fields, and display the form in a form interface; An acquisition module, used for acquiring data input in a dynamic column of the form; A saving module, used for saving the data inputted in the dynamic column of the form in the form data table, and obtaining the form data table having the data; The acquisition module is further used to acquire filtering parameters and report dynamic column information from user instructions when a report needs to be generated; the filtering parameters and the dynamic column information are represented by variables; A generation module is used to obtain a report statement file; parse the report statement file to obtain a report generation statement; execute the report generation statement to extract data in a field corresponding to the dynamic column information of the report in a form data table having the data, and process the data in the field according to the filter parameters to obtain the report.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
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 steps of the method according to any one of claims 1 to 6 are implemented.
