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

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

Info

Publication number
CN111881660A
CN111881660A CN202010603806.5A CN202010603806A CN111881660A CN 111881660 A CN111881660 A CN 111881660A CN 202010603806 A CN202010603806 A CN 202010603806A CN 111881660 A CN111881660 A CN 111881660A
Authority
CN
China
Prior art keywords
report
data
dynamic column
generating
data table
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
CN202010603806.5A
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.)
Kingdee Medical Software Technology Co ltd
Original Assignee
Kingdee Medical Software 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 Kingdee Medical Software Technology Co ltd filed Critical Kingdee Medical Software Technology Co ltd
Priority to CN202010603806.5A priority Critical patent/CN111881660A/en
Publication of CN111881660A publication Critical patent/CN111881660A/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/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a report generation method, a report generation device, computer equipment and a storage medium. The method comprises the following steps: selecting fields in a form data table from a database according to an input form dynamic column selection instruction; generating a form comprising at least one dynamic column by utilizing the field, and displaying the form in a form interface; acquiring data input in the dynamic column of the form; storing the data input in the dynamic column of the form in the form data table to obtain the form data table with the data; when a report needs to be generated, acquiring filtering parameters and report dynamic column information; and in the form data table with the data, extracting the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data. By adopting the method to design the report, the utilization rate of the report space resource can be improved.

Description

Report generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a report generation method and apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, various reports are widely used in compensation systems of companies and enterprises and public institutions. Different companies and enterprises and institutions have different compensation schemes, and reports of different compensation schemes have different columns. How to design the report so that the report can adapt to different compensation schemes is an urgent problem to be solved.
The traditional method adopts an exhaustion method to design a report form, wherein the exhaustion method is to design all columns in the report form of different compensation schemes, then display required columns in the different compensation schemes and hide the unnecessary columns. However, when the report is designed by the method, the number of columns of the report is designed in advance, which may cause unnecessary and useless columns of the report, thereby causing a problem of waste of report space resources.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a report generation method, an apparatus, a computer device, and a storage medium, which can improve the resource utilization of the report space.
A report generation method, the method comprising:
selecting fields in a form data table from a database according to an input form dynamic column selection instruction;
generating a form comprising at least one dynamic column by utilizing the field, and displaying the form in a form interface; acquiring data input in the dynamic column of the form;
storing the data input in the dynamic column of the form in the form data table to obtain the form data table with the data;
when a report needs to be generated, acquiring filtering parameters and report dynamic column information;
and in the form data table with the data, extracting the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data.
In one embodiment, the method further comprises:
determining a project scheme, wherein the project scheme comprises at least one project;
sequentially reading items in the item scheme, and generating fields of the form data table according to the read items;
and if the items in the item scheme are all read, creating a form data table according to the generated fields.
In one embodiment, the method further comprises:
generating the name of the field according to the project identification;
and generating the table name of the form data table according to the project scheme identification.
In one embodiment, the method further comprises:
before the selecting a field in the form data table in the database according to the input form dynamic column selection instruction, the method further comprises:
when a form viewing instruction is detected, displaying a form dynamic column selection interface;
and acquiring the dynamic column selection instruction of the form triggered in the dynamic column selection interface of the form.
In one embodiment, the extracting data according to the filtering parameters and the report dynamic column information in the form data table with the data, and generating a report according to the extracted data includes:
acquiring a report statement file;
analyzing the report statement file to obtain a report generation statement;
and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
In one embodiment, the generating a report from the extracted data comprises:
extracting header information in the report statement file;
judging whether the header information contains a dynamic column mark and a double header mark;
if the header information comprises the dynamic column marks and the double-header marks, generating a header list set according to the header information, the dynamic column marks and the double-header marks;
and generating a report according to the header list set and the extracted data.
In one embodiment, the method further comprises:
if the header information does not contain the dynamic column marks and the double-header marks, generating a header column according to the header information;
and generating a report according to the header list and the extracted data.
A report generation apparatus, the apparatus comprising:
the selection module is used for selecting fields in the form data table in the database according to the input form dynamic column selection instruction;
the generating module is used for generating a form comprising at least one dynamic column by utilizing the field and displaying the form in a form interface;
the acquisition module is used for acquiring data input in the dynamic column of the form;
the storage module is used for storing the data input in the dynamic column of the form in the form data table to obtain the form data table with the data;
the acquisition module is used for acquiring filtering parameters and report dynamic column information when a report needs to be generated;
and the generating module is used for extracting data from the form data table with the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data.
In one embodiment, the apparatus further comprises:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a project scheme, and the project scheme comprises at least one project;
the generating module is further used for sequentially reading the items in the item scheme and generating the fields of the form data table according to the read items;
and the creating module is used for creating a form data table according to each generated field if all the items in the item scheme are read.
In one embodiment, the apparatus further comprises:
the generating module is further configured to generate a name of the field according to the item identifier; and generating the table name of the form data table according to the project scheme identification.
In one embodiment, the apparatus further comprises:
the display module is used for displaying the list dynamic column selection interface when the list viewing instruction is detected;
the obtaining module is used for obtaining the dynamic column selection instruction of the form triggered in the dynamic column selection interface of the form.
In one embodiment, the generation module is further configured to:
acquiring a report statement file;
analyzing the report statement file to obtain a report generation statement;
and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
In one embodiment, the generation module is further configured to:
extracting header information in the report statement file;
judging whether the header information contains a dynamic column mark and a double header mark;
if the header information comprises the dynamic column marks and the double-header marks, generating a header list set according to the header information, the dynamic column marks and the double-header marks;
and generating a report according to the header list set and the extracted data.
In one embodiment, the apparatus further comprises:
the generating module is further configured to generate a header column according to the header information if the header information does not include the dynamic column flag and the dual-header flag; and generating a report according to the header list and the extracted data.
A computer device comprising a memory and a processor, said memory storing a computer program, characterized in that said processor, when executing said computer program, implements the steps of the method for optimizing parameters of a cable intermediate joint.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for optimizing parameters of a cable intermediate joint.
In the above embodiment, when generating the report, the computer device generates the report by using the data in the form according to the filtering parameter and the report dynamic column information acquired from the user instruction. Because different user instructions contain different filtering parameters and report dynamic column information, the computer equipment can generate reports with different dynamic columns according to different user instructions, all possible columns in the reports do not need to be designed and stored in the database in advance, and the report storage space is saved.
Drawings
FIG. 1a is a diagram of an application environment of a report generation method in an embodiment;
FIG. 1b is a flowchart illustrating a report generation method according to an embodiment;
FIG. 2 is a timing diagram of the generation of a form in one embodiment;
FIG. 3 is a flowchart illustrating a report generation method according to another embodiment;
FIG. 4 is a timing diagram illustrating the generation of a report in one embodiment;
FIG. 5 is a block diagram showing the structure of a report generation apparatus according to an embodiment;
FIG. 6 is a block diagram showing the structure of a report generation apparatus according to another embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The report generation method provided by the application can be applied to the application environment shown in fig. 1 a. Wherein the terminal 102 communicates with the server 104 via a network. The report generation method can be applied to the terminal 102 and also can be applied to 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 indication of the dynamic column selection instruction of the form, selects the fields corresponding to the dynamic columns of the form in the form data table of the database, generates the 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 the data in the corresponding form data table. Finally, when a report needs to be generated, the server 104 extracts data in the form data table according to the acquired filtering parameters and the report dynamic column information, generates a report, and displays the report on the terminal 102.
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 indication of the dynamic column selection instruction of the form, 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 acquires the data input in the dynamic column of the form and stores the data in the corresponding form data table. Finally, when a report needs to be generated, the terminal 102 extracts data in the form data table according to the acquired filtering parameters and the report dynamic column information, generates a report, and then displays the report.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 1b, a report generation method is provided, which is described by taking the method as an example applied to the server 104 in fig. 1a, and includes the following steps:
s102, selecting fields in the form data table in the database according to the input form dynamic column selection instruction.
The form is a form displayed to a user on a display interface, and is used for displaying or collecting data for the user. According to different user requirements, the server needs to display the forms with different dynamic columns to the user so that the user can view and input data. For example, for a form of a compensation system, different compensation items are displayed in the dynamic column of the form, respectively. For example, compensation items such as basic salary, performance, night shift subsidy, traffic subsidy, project rewards, etc. may be displayed in the dynamic column. The data in the dynamic column of the form is stored in the corresponding fields of the form data table in the database.
The form dynamic column selection instruction is used for instructing a server to show which dynamic columns in the form to a user. And the server selects a field corresponding to the dynamic column selected by the dynamic column selection instruction in the form data table of the database according to the instruction of the dynamic column selection instruction of the form. For example, the dynamic column selection instruction of the form instructs the server to display the dynamic columns of basic payroll, traffic subsidy and night shift subsidy in january in the form, and the server selects the basic payroll field, the traffic subsidy field and the night shift subsidy field in the form data table according to the instruction.
And S104, generating a form comprising at least one dynamic column by using the fields, and displaying the form in a form interface.
After selecting the fields in the form data table, the server acquires the field names of the selected fields and the data types of the fields. And then, generating a corresponding form according to the field name and the data type of the field, and displaying the form to a user in a form interface. And if the fields in the form data table selected by the server store data, displaying the data in the fields in the dynamic column of the form. And the user can view the data in the form or edit the data through the form displayed in the form interface.
S106, acquiring data input in the dynamic column of the form.
And after the server shows the form to the user, acquiring data input by the user in the dynamic column of the form according to the editing instruction of the user. Wherein, the server supports the user to input the editing instruction in a text form, or input the editing instruction in a voice or other forms.
And S108, storing the data input in the dynamic column of the form in a form data table to obtain the form data table with the data.
After the server acquires the data input by the user in the dynamic column of the form, the acquired data is stored in a form data table corresponding to the form, and the form data table stores the data collected by the user. And when an instruction of the user for viewing the form is detected, the server generates the form by using the data in the form data sheet according to the instruction of the user and displays the form to the user.
S110, when the report needs to be generated, the filtering parameters and the report dynamic column information are obtained.
The report is a table generated according to the data after the data in the table is operated. And the server displays the result of analyzing and summarizing the data in the form to the user in the form.
The filtering parameters are conditions for filtering the data for generating the report forms, and the range for filtering the data for generating the report forms is determined. For example, if the filtering parameter is X department, the server filters all data of X department according to the filtering parameter. For example, if the filtering parameter is month 1 to 6, the server filters out all the data of month 1 to 6 according to the filtering parameter.
The report dynamic column information is information indicating which dynamic columns are included in the report and is used for indicating how the server selects fields corresponding to the dynamic columns in the form data table and the report. For example, the report dynamic column information may be the sum of the basic payroll and the night shift subsidy, and the rate of performance increase from the same period of the last year, and the server selects the data of the fields corresponding to the basic payroll, the night shift subsidy, and the performance in the form data table according to the report dynamic column information, and performs an operation according to the selected data to generate a report including the dynamic column of the sum of the basic payroll and the night shift subsidy, and the rate of performance increase from the same period of the last year.
And S112, extracting data from the form data table with the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data.
In one embodiment, the server extracts data from the form data table with data according to the filtering parameters and the dynamic column information of the form, and generates the form according to the extracted data includes: determining fields corresponding to report dynamic column information in a form data table with data; and processing the data corresponding to the field according to the filtering parameters to obtain a report.
And the server selects data of the corresponding field in the form data table according to the report dynamic column information, screens the data in the field according to the filtering parameters, and calculates the screened data to obtain the report.
For example, when the server displays basic wages, the sum of night shift subsidies and the increase rate of the performance in the same period as last year of more than 3 grades of employees in X department in the report according to the instruction input by the user, the server firstly extracts the data of corresponding fields of the basic wages, the night shift subsidies and the performance in the form data sheet according to the report dynamic column information. And then screening data of corresponding fields of X departments and employees with more than 3 levels in 1-6 months according to the filtering parameters. And after the server extracts the data from the form data table, summing the data of the night shift subsidy field, calculating the increase rate of the data of the performance field, generating a report according to the calculated data and displaying the report to a user.
In the above embodiment, when generating the report, the server generates the report by using the data in the form according to the filtering parameter and the report dynamic column information acquired from the user instruction. Because different user instructions contain different report dynamic column information, the server can generate reports with different dynamic columns according to different user instructions, and all possible columns in the reports do not need to be designed and stored in the database in advance, so that the storage space of the reports is saved.
In one embodiment, the server dynamically generates a form data table with non-fixed columns according to the project schema. The server determines a project scheme, wherein the project scheme comprises at least one project; sequentially reading items in the item scheme, and generating fields of the form data table according to the read items; and if all the items in the item scheme are read, creating a form data table according to the generated fields.
Wherein, different items are set in the project plan, for example, for a compensation system, the project plan includes: basic wages, overtime subsidies, performance, project bonuses, etc. Items in the item scheme are displayed in the form dynamic column form, and are stored in the form data table in the form field form.
In one embodiment, the server generates the name of the field according to the item identification; and generating the table name of the form data table according to the project scheme identification. For example, the name and the item identification of the field in the form data table generated by the server are the same, and the table name and the item scheme identification of the generated form data table are the same.
The server circularly reads the project creation form data table in the project scheme, the form data table with different fields is created according to different project schemes, the project scheme comprises a plurality of projects, the form data table generated by the server can comprise a plurality of fields, and the fields in the form data table are not limited by the number of columns. Because the server generates the form and the report according to the fields in the form data table, when the fields in the form data table can be dynamically generated according to the project schemes, the dynamic columns in the form and the report can also be dynamically generated according to the project schemes, the form and the report dynamically generated according to the project schemes have flexible frameworks, and the requirements of various project schemes can be met. Because the form and the report form which comprise the dynamic columns corresponding to the projects in all project schemes do not need to be designed in advance, the complexity of the form and the report form development is reduced, the form and the report form development is faster, and the waste of storage space can be avoided.
In one embodiment, before the server selects a field in the form data table in the database according to the input dynamic column selection instruction of the form, the method further includes: when a form viewing instruction is detected, displaying a form dynamic column selection interface; and acquiring a dynamic list selection instruction of the form triggered in the dynamic list selection interface of the form.
The server supports a list selection command triggered in a click mode, or the server can also support a list selection command triggered in a voice signal mode, or the list selection command triggered in other modes.
In one embodiment, the process of the server generating and presenting the form to the user is shown in FIG. 2:
s202, obtaining a view form instruction.
S204, displaying the dynamic list selection interface of the form.
S206, a list dynamic selection instruction is obtained.
And S208, selecting the field according to the dynamic column selection instruction of the form.
And S210, generating a form.
S212, displaying the form in the form interface.
The specific contents of S202 to S212 may refer to the specific implementation processes described above.
In one embodiment, the server extracts data from the form data table with data according to the filtering parameters and the dynamic column information of the form, and generates the form according to the extracted data includes: acquiring a report statement file; analyzing the report statement file to obtain a report generation statement; and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
The report statement file defines report statements, the server analyzes the report statements in the report statement file to obtain report generation statements, and the report generation statements comprise statements for selecting data and statements for operating the data to generate reports.
In one embodiment, the process of parsing the report statement file by the computer device comprises: (1) and checking whether the report statement uses a self-defined loop function or not, and acquiring a loop variable of the loop function and a loop statement executed in a loop mode. And replacing the loop variable with the report dynamic column information, and executing the loop statement under the condition indicated by the report dynamic column information. (2) And replacing the filtering parameter variable in the report statement by the filtering parameter. (3) And replacing the table name variable in the report statement by the table name of the created report.
In one embodiment, the report statement file is an XML (Extensible Markup Language) formatted file. XML is a markup language for marking electronic documents to be structured, can be used to mark data, define data types, and is a source language that allows users to define their own markup language.
In one embodiment, the report statement is written in the SQL (Structured Query Language) Language. The SQL language is a database query and programming language for accessing data and querying, updating, and managing relational database systems. The SQL language does not require a user to specify a data storage method, and does not require the user to know a specific data storage mode, so that different database systems with completely different underlying structures are provided.
In one embodiment, the report statement file has < fields > defined the report header information; describing a dynamic column by using < fieldvariable @ FieldItem @/> or describing whether the header of the report supports double-header display; the loop statement for report execution is defined by < sql >.
And the server executes the report generation statement, extracts data in a field corresponding to the report dynamic column information in the form data table through the execution of the report generation statement, screens the data in the field according to the filtering parameters, selects data meeting conditions, and operates the screened data to obtain the report.
The server defines the report statement in the report statement file, so that the report statement and the report design process are separated, the report statement is convenient to edit and change, and the report is convenient to develop and maintain. And because the filtering parameters and the dynamic column information of the report are expressed by using the variables in the report statement, when the report is actually generated, the server can replace the variables in the report statement with the obtained filtering parameters and the dynamic column information to obtain the report generation statement, and different reports can be generated by extracting and processing data by executing the report generation statement, so that the design process of the report is simplified.
In one embodiment, the server generating the report from the extracted data comprises: extracting header information in the report statement file; judging whether the header information contains a dynamic column mark and a double header mark; if the header information comprises the dynamic column marks and the double header marks, generating a header list set according to the header information, the dynamic column marks and the double header marks; and generating a report according to the header column set and the extracted data.
Because the header in the report can also be displayed in a dynamic column mode, the server judges whether the header of the report is displayed in the dynamic column mode according to the header information in the report statement file. And if the header information contains a dynamic column mark and a double-header mark, the header of the report is displayed in a dynamic column mode. And the server generates a header column set according to the header information, the dynamic column marks and the double header marks, and generates a report according to the header column set and the extracted data to display the report to a user.
In one embodiment, if the header information does not contain the dynamic column flag and the dual-header flag, the server generates a header column according to the header information; and generating a report according to the header columns and the extracted data.
If the header information does not contain the dynamic column mark and the double-header mark, the report is a fixed header and is not displayed in a dynamic column mode. And the server generates a header list according to the header information, and generates a report according to the header list and the extracted data to display the report to a user.
The server sets header information in the report statement file, and dynamically generates the header of the report according to the type of the report, so that the design of the header of the report is more convenient and simpler, and the requirements of different reports are met.
In one embodiment, the process of generating the report by the server is shown in fig. 3, and includes the following steps:
and S302, creating a report.
S304, displaying an interface for acquiring the dynamic column information and the filter parameters.
S306, acquiring the dynamic column information and the filtering parameters.
S308, obtaining report statement files.
And S310, replacing the loop variable with the report dynamic column information, and executing the loop statement under the condition indicated by the report dynamic column information.
S312, replacing the filtering parameter variable in the report statement by the filtering parameter to obtain a report generation statement.
And S314, executing the report generation statement to generate the report.
And S316, displaying the report.
The specific contents of S302 to S316 mentioned above may refer to the specific implementation process described above.
In one embodiment, a computer device generates and displays a form, and a timing chart of generating a report according to data in a form data table is shown in fig. 4, and includes the following steps:
s402, acquiring a selection item scheme instruction.
S404, creating a form data table.
S406, storing the form data table in a database.
S408, a list dynamic selection instruction is obtained.
S410, selecting fields in the form data table.
And S412, generating the form by using the fields in the form data table.
And S414, displaying the form in the form interface.
S416, data input in the dynamic column of the form is obtained.
S418, the data entered in the dynamic column of the form is stored in the form data table.
And S420, acquiring the filtering parameters and the report dynamic column information.
S422, the report statement file is obtained and analyzed to obtain report generation statement
S424, executing the report generation statement to extract the data in the field corresponding to the report dynamic column information in the form data table
And S426, executing the report generation statement, and generating a report according to the data in the extracted form data table.
And S428, displaying the report.
The specific contents of the above-mentioned S402 to S428 may refer to the specific implementation process described above.
It should be understood that although the various steps in the flow charts of fig. 1b-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1b-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 5, there is provided a report generating apparatus including: a selecting module 502, a generating module 504, an obtaining module 506 and a storing module 508, wherein:
a selecting module 502, configured to select a field in the form data table in the database according to the input form dynamic column selection instruction;
a generating module 504, configured to generate a form including at least one dynamic column by using the field, and display the form in a form interface;
an obtaining module 506, configured to obtain data input in a dynamic column of the form;
a saving module 508, configured to save the data input in the dynamic column of the form in a form data table, to obtain a form data table with data;
the obtaining module 502 is further configured to obtain a filtering parameter and report dynamic column information when a report needs to be generated;
the generating module 504 is configured to extract data from the form data table with data according to the filtering parameter and the dynamic column information of the report, and generate a report according to the extracted data.
In the above embodiment, when generating the report, the computer device generates the report by using the data in the form according to the filtering parameter and the report dynamic column information acquired from the user instruction. Because different user instructions contain different filtering parameters and report dynamic column information, the computer equipment can generate reports with different dynamic columns according to different user instructions, all possible columns in the reports do not need to be designed and stored in the database in advance, and the report storage space is saved.
In one embodiment, as shown in fig. 6, the apparatus further comprises:
a determining module 510, configured to determine a project scheme, where the project scheme includes at least one project;
the generating module 504 is further configured to sequentially read items in the item scheme, and generate a field of the form data table according to the read items;
and a creating module 512, configured to create a form data table according to each generated field if all items in the item scheme are read.
In one embodiment, the apparatus further comprises:
the generating module 504 is further configured to generate a name of the field according to the item identifier; and generating the table name of the form data table according to the project scheme identification.
In one embodiment, the apparatus further comprises:
the display module 514 is configured to display the dynamic column selection interface of the form when the form viewing instruction is detected;
the obtaining module 506 is configured to obtain a dynamic column selection instruction of the form triggered in the dynamic column selection interface.
In one embodiment, the generation module 504 is further configured to:
acquiring a report statement file;
analyzing the report statement file to obtain a report generation statement;
and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
In one embodiment, the generation module 504 is further configured to:
extracting header information in the report statement file;
judging whether the header information contains a dynamic column mark and a double header mark;
if the header information comprises the dynamic column marks and the double header marks, generating a header list set according to the header information, the dynamic column marks and the double header marks;
and generating a report according to the header column set and the extracted data.
In one embodiment, the apparatus further comprises:
the generating module 504 is further configured to generate a header column according to the header information if the header information does not include the dynamic column flag and the dual-header flag; and generating a report according to the header columns and the extracted data.
For the specific definition of the report generation apparatus, reference may be made to the above definition of the report generation method, which is not described herein again. All or part of the modules in the report generation device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server or a terminal, and is illustrated by taking a terminal as an example, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing report generation data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a report generating method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: selecting fields in a form data table from a database according to an input form dynamic column selection instruction; generating a form comprising at least one dynamic column by utilizing the fields, and displaying the form in a form interface; acquiring data input in a dynamic column of a form; storing data input in the dynamic column of the form in a form data table to obtain the form data table with the data; when a report needs to be generated, acquiring filtering parameters and report dynamic column information; and in the form data table with data, extracting the data according to the filtering parameters and the dynamic column information of the report, and generating the report according to the extracted data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining a project scheme, wherein the project scheme comprises at least one project; sequentially reading items in the item scheme, and generating fields of the form data table according to the read items; and if all the items in the item scheme are read, creating a form data table according to the generated fields.
In one embodiment, the processor, when executing the computer program, further performs the steps of: generating the name of the field according to the project identifier; and generating the table name of the form data table according to the project scheme identification.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when a form viewing instruction is detected, displaying a form dynamic column selection interface; and acquiring a dynamic list selection instruction of the form triggered in the dynamic list selection interface of the form.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a report statement file; analyzing the report statement file to obtain a report generation statement; and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
In one embodiment, the processor, when executing the computer program, further performs the steps of: extracting header information in the report statement file; judging whether the header information contains a dynamic column mark and a double header mark; if the header information comprises the dynamic column marks and the double header marks, generating a header list set according to the header information, the dynamic column marks and the double header marks; and generating a report according to the header column set and the extracted data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the header information does not contain the dynamic column mark and the double-header mark, generating a header column according to the header information; and generating a report according to the header columns and the extracted data.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: selecting fields in a form data table from a database according to an input form dynamic column selection instruction; generating a form comprising at least one dynamic column by utilizing the fields, and displaying the form in a form interface; acquiring data input in a dynamic column of a form; storing data input in the dynamic column of the form in a form data table to obtain the form data table with the data; when a report needs to be generated, acquiring filtering parameters and report dynamic column information; and in the form data table with data, extracting the data according to the filtering parameters and the dynamic column information of the report, and generating the report according to the extracted data.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a project scheme, wherein the project scheme comprises at least one project; sequentially reading items in the item scheme, and generating fields of the form data table according to the read items; and if all the items in the item scheme are read, creating a form data table according to the generated fields.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating the name of the field according to the project identifier; and generating the table name of the form data table according to the project scheme identification.
In one embodiment, the computer program when executed by the processor further performs the steps of: when a form viewing instruction is detected, displaying a form dynamic column selection interface; and acquiring a dynamic list selection instruction of the form triggered in the dynamic list selection interface of the form.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a report statement file; analyzing the report statement file to obtain a report generation statement; and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
In one embodiment, the computer program when executed by the processor further performs the steps of: extracting header information in the report statement file; judging whether the header information contains a dynamic column mark and a double header mark; if the header information comprises the dynamic column marks and the double header marks, generating a header list set according to the header information, the dynamic column marks and the double header marks; and generating a report according to the header column set and the extracted data.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the header information does not contain the dynamic column mark and the double-header mark, generating a header column according to the header information; and generating a report according to the header columns and the extracted data.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A report generation method is characterized by comprising the following steps:
selecting fields in a form data table from a database according to an input form dynamic column selection instruction;
generating a form comprising at least one dynamic column by utilizing the field, and displaying the form in a form interface;
acquiring data input in the dynamic column of the form;
storing the data input in the dynamic column of the form in the form data table to obtain the form data table with the data;
when a report needs to be generated, acquiring filtering parameters and report dynamic column information;
and in the form data table with the data, extracting the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data.
2. The method according to claim 1, characterized in that it comprises:
determining a project scheme, wherein the project scheme comprises at least one project;
sequentially reading items in the item scheme, and generating fields of the form data table according to the read items;
and if the items in the item scheme are all read, creating a form data table according to the generated fields.
3. The method of claim 2, further comprising:
generating the name of the field according to the project identification;
and generating the table name of the form data table according to the project scheme identification.
4. The method of claim 1, wherein before the selecting the field in the form data table in the database according to the input dynamic column selection instruction of the form, the method further comprises:
when a form viewing instruction is detected, displaying a form dynamic column selection interface;
and acquiring the dynamic column selection instruction of the form triggered in the dynamic column selection interface of the form.
5. The method of claim 1, wherein extracting data from the filter parameters and the report dynamic column information in the form data table with the data and generating a report from the extracted data comprises:
acquiring a report statement file;
analyzing the report statement file to obtain a report generation statement;
and executing the report generation statement to extract data in a field corresponding to the report dynamic column information from the form data table with the data, and processing the data in the field according to the filtering parameters to obtain the report.
6. The method of any of claims 1 to 4, wherein generating a report from the extracted data comprises:
extracting header information in the report statement file;
judging whether the header information contains a dynamic column mark and a double header mark;
if the header information comprises the dynamic column marks and the double-header marks, generating a header list set according to the header information, the dynamic column marks and the double-header marks;
and generating a report according to the header list set and the extracted data.
7. The method of claim 6, further comprising:
if the header information does not contain the dynamic column marks and the double-header marks, generating a header column according to the header information;
and generating a report according to the header list and the extracted data.
8. A report generation apparatus, characterized in that the apparatus comprises:
the selection module is used for selecting fields in the form data table in the database according to the input form dynamic column selection instruction;
the generating module is used for generating a form comprising at least one dynamic column by utilizing the field and displaying the form in a form interface;
the acquisition module is used for acquiring data input in the dynamic column of the form;
the storage module is used for storing the data input in the dynamic column of the form in the form data table to obtain the form data table with the data;
the acquisition module is used for acquiring filtering parameters and report dynamic column information when a report needs to be generated;
and the generating module is used for extracting data from the form data table with the data according to the filtering parameters and the dynamic column information of the form, and generating the form according to the extracted data.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010603806.5A 2020-06-29 2020-06-29 Report generation method and device, computer equipment and storage medium Pending CN111881660A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010603806.5A CN111881660A (en) 2020-06-29 2020-06-29 Report generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010603806.5A CN111881660A (en) 2020-06-29 2020-06-29 Report generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111881660A true CN111881660A (en) 2020-11-03

Family

ID=73157188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010603806.5A Pending CN111881660A (en) 2020-06-29 2020-06-29 Report generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111881660A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112528613A (en) * 2020-12-21 2021-03-19 金蝶软件(中国)有限公司 Data table generation method and related equipment thereof
CN115099206A (en) * 2022-08-23 2022-09-23 佰墨思(成都)数字技术有限公司 Method and system for generating dynamic form in full-period process of biopharmaceutical production

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010204951A (en) * 2009-03-03 2010-09-16 Mizuho Information & Research Institute Inc Business form creation processing system, method, and program
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN109271411A (en) * 2018-09-28 2019-01-25 中国平安财产保险股份有限公司 Report form generation method, device, computer equipment and storage medium
CN111158795A (en) * 2019-12-24 2020-05-15 深圳壹账通智能科技有限公司 Report generation method, device, medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010204951A (en) * 2009-03-03 2010-09-16 Mizuho Information & Research Institute Inc Business form creation processing system, method, and program
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN109271411A (en) * 2018-09-28 2019-01-25 中国平安财产保险股份有限公司 Report form generation method, device, computer equipment and storage medium
CN111158795A (en) * 2019-12-24 2020-05-15 深圳壹账通智能科技有限公司 Report generation method, device, medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112528613A (en) * 2020-12-21 2021-03-19 金蝶软件(中国)有限公司 Data table generation method and related equipment thereof
CN115099206A (en) * 2022-08-23 2022-09-23 佰墨思(成都)数字技术有限公司 Method and system for generating dynamic form in full-period process of biopharmaceutical production

Similar Documents

Publication Publication Date Title
US9811604B2 (en) Method and system for defining an extension taxonomy
US9047346B2 (en) Reporting language filtering and mapping to dimensional concepts
CN108874924B (en) Method and device for creating search service and computer-readable storage medium
CN102541867A (en) Data dictionary generating method and system
US7093207B1 (en) Data analysis flow engine
CN104881275A (en) Electronic spreadsheet generating method and device
CN106951231B (en) Computer software development method and device
US20110252049A1 (en) Function execution using sql
US20150261525A1 (en) Analyzing components related to a software application in a software development environment
CN103646049A (en) Method and system for automatically generating data report
CN111881660A (en) Report generation method and device, computer equipment and storage medium
CN112433712A (en) Report display method and device, computer equipment and storage medium
CN110941629A (en) Metadata processing method, device, equipment and computer readable storage medium
US20140143270A1 (en) Generating dynamic drilldown reports
JP2024505236A (en) Data set multiplexer for data processing systems
CN111984659B (en) Data updating method, device, computer equipment and storage medium
US7873902B2 (en) Transformation of versions of reports
CN103809915B (en) The reading/writing method of a kind of disk file and device
CN111008198B (en) Service data acquisition method and device, storage medium and electronic equipment
CN114238467A (en) Structured data analysis method and system
CN111367976B (en) Method and device for exporting EXCEL file data based on JAVA reflection mechanism
CN107729013B (en) Method for managing operation buttons on web page and computer-readable storage medium
CN114548062B (en) Report arranging method
CA2663859C (en) Apparatus and method for updating a report through view time interaction
CN115423582A (en) Financial document information display method and device and electronic equipment

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