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

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

Info

Publication number
CN113268968A
CN113268968A CN202110467668.7A CN202110467668A CN113268968A CN 113268968 A CN113268968 A CN 113268968A CN 202110467668 A CN202110467668 A CN 202110467668A CN 113268968 A CN113268968 A CN 113268968A
Authority
CN
China
Prior art keywords
data
page
blank page
dimension
initial
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
CN202110467668.7A
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.)
Qichacha Technology Co ltd
Original Assignee
Qichacha 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 Qichacha Technology Co ltd filed Critical Qichacha Technology Co ltd
Priority to CN202110467668.7A priority Critical patent/CN113268968A/en
Publication of CN113268968A publication Critical patent/CN113268968A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application relates to a report file generation method, a report file generation device, a computer device and a storage medium, wherein an enterprise data stream and an initial file data stream are obtained, page content data corresponding to an initial blank page are filled into the initial blank page to obtain an intermediate file data stream, a new blank page is generated based on the intermediate file data stream, and page content data corresponding to the new blank page are filled into the new blank page to obtain a report file data stream; therefore, the target report file is generated according to the report file data stream, the generation speed of the report file is accelerated, and the time for a user to wait for the generation of the report file is shortened.

Description

Report file 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 method and an apparatus for generating a report file, a computer device, and a storage medium.
Background
With the development of computer technology, report file automatic generation technology has emerged. For example, the business information of a certain enterprise is quickly and completely presented to the user with corresponding requirements, and an enterprise business information report file can be generated through a report file automatic generation technology. However, the generation manner of the report file in the conventional art affects the generation speed of the report file.
Disclosure of Invention
In view of the above, it is desirable to provide a report file generation method, an apparatus, a computer device, and a storage medium capable of increasing a report file generation speed.
A method for generating a report file, the method comprising:
acquiring enterprise data and an initial file data stream, wherein the initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page;
filling page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generating a new blank page based on the intermediate file data stream, wherein the enterprise data further comprises page content data corresponding to the new blank page;
filling the page content data corresponding to the new blank page to obtain a report file data stream;
and generating a target report file according to the report file data stream.
In one embodiment, before the obtaining the enterprise data and the initial file data stream, the method further comprises:
acquiring a generation request of a report file, wherein the generation request comprises a report type and an enterprise identifier;
and searching according to the report type and the enterprise identification to obtain the enterprise data.
In one embodiment, the initial blank page includes a cover page, and the page content data corresponding to the initial blank page includes a cover picture; the filling the page content data corresponding to the initial blank page into the initial blank page includes:
the cover picture is placed on the upper layer of the cover page, the cover picture covers the preset range of the cover page, and the preset range is the partial region or the whole region of the cover page.
In one embodiment, the new blank page includes a back cover page, and the page content data corresponding to the new blank page includes a back cover picture; the step of filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream includes:
and placing the back cover picture on the upper layer of the back cover page, wherein the back cover picture covers the preset range of the back cover page.
In one embodiment, the enterprise data further includes header data and footer data, the header data includes header content, the footer data includes footer content, the initial blank page has a header position and a footer position, and the populating the initial blank page with the page content data corresponding to the initial blank page further includes:
placing the header content on the initial blank page according to the header position on the initial blank page;
and placing the footer content on the initial blank page according to the footer position on the initial blank page.
In one embodiment, the step of filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream includes:
taking the text data corresponding to the data dimension as a title text, and setting a title style of the title text;
and inserting the title text into the new blank page according to the title style.
In one embodiment, the page content data corresponding to the new blank page further includes dimension data in each data dimension, and after the header text content is inserted into the new blank page, the method further includes:
and responding to a line feed instruction, and inserting the dimension data on each data dimension into the new blank page according to a preset pattern.
In one embodiment, the inserting the dimension data in each data dimension into the new blank page according to a preset pattern includes:
detecting a presentation style of each dimension datum;
if the presentation style is a table style, creating table cells in the new blank page, acquiring corresponding cell data from the dimension data, and inserting the cell data into the cells;
and if the presentation style is a chart style, creating a blank chart in the new blank page, and binding the dimension data with the blank chart to generate a corresponding chart.
In one embodiment, the data dimension includes a first-level dimension and a second-level dimension, and before the text data corresponding to the data dimension is used as the title text, the method further includes:
judging whether corresponding dimension data exist in each second-level dimension;
and if the first-level dimension does not exist, the text data corresponding to the first-level dimension does not need to be inserted into the new blank page as a title text.
In one embodiment, the data dimension includes a first-level dimension and a second-level dimension, and after the text data corresponding to the data dimension is used as the title text, the method further includes:
judging whether corresponding dimension data exist in each second-level dimension;
and if the new blank page does not exist, deleting the title text corresponding to the first-level dimension from the new blank page, wherein the title text corresponding to the first-level dimension is generated based on the text data corresponding to the first-level dimension.
In one embodiment, the page content data corresponding to the new blank page is provided with a data dimension, and before the page content data corresponding to the new blank page is filled into the new blank page to obtain a report file data stream, the method further includes:
judging whether corresponding dimension data exist in the data dimension;
if the enterprise data does not exist in the data dimension, the text data corresponding to the data dimension is used as a title text, the title text and prompt text data are inserted into the new blank page, and the prompt text data are used for indicating that no enterprise data corresponding to the data dimension exists; or
And if the data dimension does not exist, inserting the text data corresponding to the data dimension into the new blank page.
A report file generation apparatus, the apparatus comprising:
the file data acquisition module is used for acquiring enterprise data and an initial file data stream, wherein the initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page;
a first filling module, configured to fill the page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generate a new blank page based on the intermediate file data stream, where the enterprise data further includes page content data corresponding to the new blank page;
the second filling module is used for filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream;
and the report file generation module is used for generating a target report file according to the report file data stream.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method of any preceding claim when the processor executes the computer program.
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 of the above.
According to the report file generation method, the report file generation device, the computer equipment and the storage medium, the enterprise data and the initial file data stream are obtained, the page content data corresponding to the initial blank page is filled into the initial blank page to obtain the intermediate file data stream, the new blank page is generated based on the intermediate file data stream, and the page content data corresponding to the new blank page is filled into the new blank page to obtain the report file data stream; therefore, the target report file is generated according to the report file data stream, the generation speed of the report file is accelerated, and the time for a user to wait for the generation of the report file is shortened.
Drawings
FIG. 1 is a diagram of an application environment of a report file generation method in one embodiment;
FIG. 2 is a flow diagram illustrating a method for generating a report file in one embodiment;
FIG. 3 is a flowchart illustrating a method for generating a report file according to an embodiment;
FIG. 4 is a flowchart illustrating the step S220 according to one embodiment;
FIG. 5 is a flowchart illustrating the step S230 according to one embodiment;
FIG. 6 is a flowchart illustrating the step S520 according to an embodiment;
FIG. 7 is a flowchart illustrating a report file generation method according to an embodiment;
FIG. 8 is a flowchart illustrating a method for generating a report file in one embodiment;
FIG. 9 is a block diagram showing the construction of a report file generating apparatus according to an embodiment;
FIG. 10 is a diagram showing 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 file generation method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 triggers a request for generation of a report file and sends the request for generation to the server 104, the request for generation including the report type and the business identification. The server 104 searches according to the report type and the enterprise identifier to obtain enterprise data, and obtains an initial file data stream according to the report type, wherein the initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page; the server 104 fills the page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generates a new blank page based on the intermediate file data stream, wherein the enterprise data further includes page content data corresponding to the new blank page; filling the page content data corresponding to the new blank page to obtain a report file data stream; and generating a target report file according to the report file data stream.
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. 2, a report file generation method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
and S210, acquiring enterprise data and an initial file data stream.
The initial file data stream may be a blank file stream, such as a blank word file stream, a blank TEX file stream, a blank LaTex file stream, a blank slide (such as Microsoft Office PowerPoint) file stream, a blank table (Excel) file stream, and the like. The enterprise data may be data stored in a database that is relevant to enterprise operations. The enterprise data is used to fill in the gaps in the initial file data stream. Specifically, a request for generating a report file can be sent to the server through the terminal, and the server searches a local database according to the report request to obtain corresponding enterprise data and an initial file data stream. The enterprise data and the initial file data stream may also be obtained from a computer device connected to the server.
S220, filling the page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generating a new blank page based on the intermediate file data stream.
The initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page. The enterprise data also includes page content data corresponding to the new blank page. The initial blank page corresponds to the first page in the report document, and may be a cover page of the report document or a title page of the report document. Specifically, after the initial file data stream is acquired, the page content data corresponding to the initial blank page is filled into the initial blank page, and the initial file data stream is supplemented to obtain an intermediate file data stream. After the initial blank page is filled, a new blank page is generated based on the intermediate file data stream. The generated new blank page may be a back cover page, a report text page, a report directory page, or a report summary page, and the generated new blank page is not illustrated one by one.
And S230, filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream.
Specifically, the new blank page needs to be filled, and the page content data corresponding to the new blank page can be acquired from the enterprise data according to the attribute data of the new blank page, so that the page content data corresponding to the new blank page is filled into the new blank page, and so on, if part of data in the enterprise data needs to be filled into the paper file data stream, the new blank page can be continuously generated, and the corresponding page content data is filled into the starry blank page in the same way until the enterprise data is used up, so that the final report file data stream is obtained.
And S240, generating a target report file according to the report file data stream.
The target report file may be a format file such as a Word file, a slide file, a table file, etc. Specifically, since the initial file data stream corresponds to the file format, the report file data stream is stored as the target report file according to the file format corresponding to the initial file data stream, which is summarized in some embodiments, the target report file may be a Word file, or a Word file may be converted into a pdf file. It is understood that the initial blank pages included in the initial document data stream and the new blank pages generated may be understood as a document stream, which is different from the pages of the target report document that present information to the user.
The report file generation method comprises the steps of obtaining enterprise data and an initial file data stream, filling page content data corresponding to an initial blank page to the initial blank page to obtain an intermediate file data stream, generating a new blank page based on the intermediate file data stream, and filling page content data corresponding to the new blank page to obtain a report file data stream; therefore, the target report file is generated according to the report file data stream, the generation speed of the report file is accelerated, and the time for a user to wait for the generation of the report file is shortened. Furthermore, the new blank page is added to the initial file data stream according to the actual situation of the obtained enterprise data, when the enterprise data corresponding to the report file changes, the report file data stream can be flexibly adjusted, the sustainable maintenance performance of the report file is improved, and the generation process of the report file is simplified.
In one embodiment, as shown in FIG. 3, prior to obtaining the enterprise data and the initial file data stream, the method further comprises:
and S310, acquiring a report file generation request.
And S320, searching according to the report type and the enterprise identification to obtain enterprise data.
Wherein the generation request includes a report type and a business identification. Specifically, platform software for generating a report file is installed on the terminal, and the platform software receives a generation request and sends the generation request to the server. The server database has a data interface, which can be understood as a set of data transfer protocols between different components in the software system. And searching in a database through a data interface according to the report type and the enterprise identification to obtain enterprise data.
In one embodiment, the initial blank page includes a cover page, and the page content data corresponding to the initial blank page includes a cover picture. Filling page content data corresponding to the initial blank page, including: and placing the cover picture on the upper layer of the cover page, wherein the cover picture covers the preset range of the cover page.
The cover picture may be a picture with enterprise tag information (such as an enterprise logo picture) and a report name. The preset range may be a partial area or a full area of the cover page. The position of the preset range in the cover page can be set according to actual conditions, and the preset range can also be determined according to the size of the cover picture and the size of the cover page. Specifically, the enterprise data includes a cover picture, the cover picture is filled into a cover page, or the cover picture is placed on an upper layer of the cover page, and the cover picture covers a partial region or a whole region of the cover page.
In the embodiment, the cover page of the report file is directly generated by using the initial blank page and the cover picture in the enterprise data, so that a fixed template is not used, and the workload of manufacturing the fixed template is reduced. Further, the fixed template in the conventional technology is fixed and unchangeable, and cannot be flexibly adjusted, and in this embodiment, the cover page of the report file is flexibly generated by using the initial blank page and the cover picture in the enterprise data, so as to meet the diversified requirements of the user.
In one embodiment, the new blank page includes a back cover page, and the page content data corresponding to the new blank page includes a back cover picture; filling the page content data corresponding to the new blank page to obtain a report file data stream, including: and placing the back cover picture on the upper layer of the back cover page, wherein the back cover picture covers the preset range of the back cover page.
The back cover picture may be a picture with enterprise tag information (such as an enterprise logo picture) and a report name. The preset range can be a partial area or a whole area of the back cover page. The position of the preset range in the back cover page can be set according to actual conditions, and the preset range can also be determined according to the size of the back cover picture and the size of the back cover page. Specifically, after the file data stream of the text of the report file is generated, new blank pages can be continuously created, and the back cover page of the report file is generated by using the new blank pages and the back cover picture.
The enterprise data comprises a back cover picture, the back cover picture is filled into a back cover page, or the back cover picture is placed on the upper layer of the back cover page, and the back cover picture covers partial or all areas of the back cover page.
In the embodiment, the cover page of the report file is directly generated by using the new blank page and the cover picture in the enterprise data, so that a fixed template is not used, and the workload of manufacturing the fixed template is reduced. Further, the fixed template in the conventional technology is fixed and unchangeable, and cannot be flexibly adjusted, and in this embodiment, the back cover page of the report file is flexibly generated by using the new blank page and the back cover picture in the enterprise data, so as to meet the diversified requirements of the user.
In one embodiment, the enterprise data further includes header data and footer data, the header data including header content, and the initial blank page having a header location. The footer data includes footer content and the initial blank page has a footer position. As shown in fig. 4, the filling the page content data corresponding to the initial blank page into the initial blank page further includes:
and S410, placing the header content on the initial blank page according to the header position on the initial blank page.
And S420, placing the footer content on the initial blank page according to the footer position on the initial blank page.
The footer content may be text information such as a contact address of an enterprise, and the header content may be image data of an enterprise logo or an enterprise name. Specifically, the header position and the footer position have been set on the initial blank page in advance. The header position may be understood as a position on the initial blank page where header content is placed, and the footer position may be understood as a position on the initial blank page where footer content is placed. The header position and the footer position may be set in conjunction with the actual situation. Setting a header and a footer on the initial blank page, placing header content at the header position on the initial blank page, and placing footer content at the footer position on the initial blank page.
In some embodiments, headers and pages are already set on the initial blank page, and headers and footers are also generated in new blank pages that are subsequently generated. The header content in the new blank page may be the same as the header content in the initial blank page, or may be different from the header content in the initial blank page, and is determined by specifically combining with the actual situation. The content of the footer in the new blank page may be the same as the content of the footer in the initial blank page, or may be different from the content of the footer in the initial blank page, and is set specifically in accordance with the actual situation.
In this embodiment, header content is placed on the initial blank page according to the header position on the initial blank page. And according to the position of the footer on the initial blank page, placing the footer content on the initial blank page. The completeness and the identification degree of the target report file are ensured, a user can conveniently and quickly read and know the content of the report file, and the readability of the report file is improved.
In one embodiment, the page content data corresponding to the new blank page is provided with a data dimension. As shown in fig. 5, the step of filling the page content data corresponding to the new blank page into the new blank page to obtain the report file data stream includes the following steps:
and S510, taking the text data corresponding to the data dimension as a title text, and setting a title style of the title text.
And S520, inserting the title text into the new blank page according to the title style.
The data dimension can include basic information, stockholder information, enterprise external investment, legal action, enterprise risk, annual newspaper information, financial information, intellectual property, operation information and other dimensions, can also be the categories of industrial and commercial basic information, lost news, court bulletins, referee documents and court bulletins, and can also include categories of tax affairs, certificates, software copyright, tendering and bidding, employee information, judicial auction and the like. Specifically, the data dimension corresponds to text data, and the text data corresponding to the data dimension is used as a title text. Title styles include font, color, segment front end, line space, reduced, etc. styles. The title style may be set in advance, or may be set according to the page size and the actual situation of the page content data. The title text is inserted into the new blank page in the title style.
In some embodiments, the data dimensions include multiple levels of dimensions, illustratively a first level dimension and a second level dimension. The first level dimension is higher than the second level dimension. The first-level dimensionality comprises dimensionalities such as basic information, stockholder information, enterprise external investment, legal action, enterprise risk, annual newspaper information, financial information, intellectual property, management information and the like, and the basic information can comprise a plurality of second-level dimensionalities such as industrial and commercial information, main personnel, branch organizations, change records, contact information and the like. The shareholder information may include two second-level dimensions, shareholder funding information and suspected actual control person information. Legal action may include second-level dimensions such as executives information, deceitlerants, referee document information, court announcements, delivery announcements, and the like. Intellectual property rights may include second-level dimensions such as patent information, trademark information, certificate qualification, software copyright information, work copyright information, website domain names, and the like. And if any data dimension comprises a second-level dimension, inserting the text data corresponding to the first-level dimension into the new blank page as the first-level title text, and responding to a line feed instruction to insert the text data corresponding to the second-level dimension into the new blank page as the second-level title text. For example, the basic information is inserted into a new blank page as the title text of the first level, and the industrial and commercial information is inserted into the new blank page as the title text of the second level in response to the line feed instruction.
It should be noted that, in some embodiments, the header texts may be all inserted into the file data stream in the manner described above, and then the enterprise data in each data dimension may be written into the body position corresponding to each header text. In other embodiments, a first-level title text corresponding to one data dimension may be inserted into a file data stream according to a preset sequence; and then responding to a line feed instruction, inserting the text data corresponding to the second-level dimension into a new blank page as a second-level title text, writing the enterprise data corresponding to the second-level dimension into a text position corresponding to the second-level title text, writing the enterprise data corresponding to the second-level dimension into a file data stream, responding to the line feed instruction again, inserting the text data corresponding to the next second-level dimension into the new blank page as the second-level title text, and inserting the text data corresponding to the next first-level dimension into the new blank page as the first-level title text. And will not be described in detail herein.
In one embodiment, the page content data corresponding to the new blank page further includes dimension data in each data dimension. After inserting the header text content into the new blank page, the method further comprises: and responding to the line feed instruction, and inserting the dimension data on each data dimension into the new blank page according to a preset pattern.
Specifically, a display style, that is, a preset style, of the dimension data in the report file may be set in advance, and after the header text is inserted into the new blank page, in response to a line feed instruction, the dimension data in each data dimension, such as business information, main staff, branch offices, change records, and contact information, is inserted into the new blank page according to the preset style.
In some embodiments, not all data dimensions have corresponding dimension data, and if there is no corresponding dimension data in a certain data dimension, the title text corresponding to the data dimension may not be displayed in the report file, or the title text corresponding to the data dimension may be displayed in the report file, and a prompt utterance without related data is displayed below the title text.
In one embodiment, as shown in fig. 6, inserting the dimension data in each data dimension into the new blank page according to a preset pattern includes the following steps:
s610, detecting the presentation style of each dimension data.
S620, if the presentation style is a table style, creating table cells in the new blank page, acquiring corresponding cell data from the dimension data, and inserting the cell data into the cells;
and S630, if the presentation style is a chart style, creating a blank chart in the new blank page, and binding the dimension data with the blank chart to generate a corresponding chart.
The dimension data can adopt different presentation styles, such as a table style, a chart style, a simple text description and the like. Specifically, after the title text is added to the new blank page, the dimension data corresponding to the title text needs to be added to the new blank page, so that the presentation style of each dimension data is detected, if the form style is detected, a cell of the form is created in the new blank page, the corresponding cell data is obtained from the dimension data, and the cell data is inserted into the cell. It is understood that the table may be a horizontal table or a column table. And if the presentation style is a chart style, creating a blank chart in the new blank page, and binding the dimension data with the blank chart to generate a corresponding chart. The chart style may be a bar chart, a line chart, a radar chart, or may be set in advance in the size such as the length and width of the chart.
If the table is a horizontal table, a first cell on a first row of the table is created in the new blank page, and corresponding enterprise data is added into the first cell; then, creating a second cell in the extending direction of the first line, and adding the corresponding enterprise data into the second cell; then, a third cell is created in the extending direction of the first row, and the corresponding enterprise data is added into the third cell; if the instruction for ending the line is triggered, performing line feed operation, creating a first cell of a second line below the first line, and filling corresponding enterprise data; and sequentially creating a second cell of the second row, filling the corresponding enterprise data until the second row is created, and the like until the creation of each row and the filling of the enterprise data are completed.
If the table is a column-oriented table, creating a first cell on a first column of the table in the new blank page, and adding corresponding enterprise data into the first cell; then, creating a second cell in the extending direction of the first column, and adding the corresponding enterprise data into the second cell; then, a third cell is created in the extending direction of the first column, and the corresponding enterprise data is added into the third cell; if the command for ending the column is triggered, performing a line feed operation, creating a first cell of a second column below the first column, and filling corresponding enterprise data; and sequentially creating a second cell of the second column, filling the corresponding enterprise data until the second column is created, and the like until the creation of each column and the filling of the enterprise data are completed.
In the embodiment, the enterprise data is visually presented to the user through the chart style or the form style, the form and the chart are flexibly generated by combining the actual condition of the enterprise data, and the flexibility and the efficiency of generating the message file are improved.
In one embodiment, the data dimensions include a first-level dimension and a second-level dimension, the first-level dimension being higher than the second-level dimension, and the first-level dimension may include at least one dimension. Second, as shown in fig. 7, before the text data corresponding to the data dimension is used as the title text, the method further includes the following steps:
s710, judging whether corresponding dimension data exist in each second-level dimension;
and S720, if the text data does not exist, inserting the text data corresponding to the first-level dimension into the new blank page as a title text.
As mentioned above, there are some enterprise data which do not correspond to the data dimensions, and in order to improve readability of the report file and reduce effort of a user for viewing the report file, text data which do not display the data dimensions may be set in the report file. Specifically, whether corresponding dimension data exists in each second-level dimension is judged; if the first-level dimension data does not exist, the first-level dimension data including the second-level dimensions does not need to be inserted into the new blank page as the title text, and corresponding dimension data does not exist in the first-level dimension.
In one embodiment, the data dimensions include a first-level dimension and a second-level dimension, the first-level dimension being higher than the second-level dimension, and the first-level dimension may include at least one dimension. As shown in fig. 8, after the text data corresponding to the data dimension is taken as the title text, the method further includes the following steps:
s810, judging whether corresponding dimension data exist in each second-level dimension;
and S820, if the new blank page does not exist, deleting the title text corresponding to the first-level dimension from the new blank page, wherein the title text corresponding to the first-level dimension is generated based on the text data corresponding to the first-level dimension.
Wherein the number of new blank pages may be greater than 1. The header text corresponding to the first dimension is generated based on the text data corresponding to the first dimension. Specifically, a header text corresponding to a first-level dimension is already inserted into the new blank page, and when the corresponding enterprise data is filled in for the header text corresponding to the first-level dimension, it is detected that corresponding dimension data does not exist in each second-level dimension included in the first-level dimension, which indicates that corresponding dimension data does not exist in the first-level dimension including the second-level dimensions, and the report file does not need to delete the header text corresponding to the first-level dimension from the new blank page.
In one embodiment, the page content data corresponding to the new blank page is provided with a data dimension. Before filling the page content data corresponding to the new blank page into the new blank page to obtain the report file data stream, the method further includes: and judging whether corresponding dimension data exist in the data dimension. And if the data dimension does not exist, taking the text data corresponding to the data dimension as a title text, and inserting the title text and the prompt text data into a new blank page. Or if the data dimension does not exist, the text data corresponding to the data dimension does not need to be inserted into a new blank page.
Where, as before, there is some enterprise data that does not have a correspondence in the data dimension. The method comprises the steps that a report file generation request is sent to a server through a terminal, the generation request carries preset parameters corresponding to report integrity, and the preset parameters can be used for determining that the report file comprises complete data dimensions or partial data dimensions, particularly data dimensions of some corresponding enterprise data. And judging whether corresponding dimension data exist in the data dimension. If the data dimension does not exist, the server can take the text data corresponding to the data dimension as a title text according to preset parameters, and insert the title text and the prompt text data into a new blank page. The hint text data is used to indicate that there is no corresponding enterprise data in the data dimension. In particular, the amount of the solvent to be used,
in some embodiments, to improve the readability of the report file and reduce the effort of the user to view the report file, text data that does not display these data dimensions may be provided in the report file. The server judges whether corresponding dimension data exist in the data dimension. If the data dimension does not exist, the server can not insert the text data corresponding to the data dimension into the new blank page according to the preset parameters, namely the new blank page is not updated.
In one embodiment, the present application provides a report file generation method, comprising the steps of:
s902, acquiring a report file generation request.
Wherein the generation request includes a report type and a business identification.
And S904, searching according to the report type and the enterprise identification to obtain the enterprise data.
And S906, acquiring an initial file data stream according to the report type.
The initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page; the initial blank page comprises a cover page, and the page content data corresponding to the initial blank page comprises a cover picture; the enterprise data further includes header data and footer data, the header data including header content, the footer data including footer content, the initial blank page having a header position and a footer position.
S908, placing the cover picture on the upper layer of the cover page, wherein the cover picture covers the preset range of the cover page.
The preset range is a partial area or a whole area of the cover page.
S910, according to the header position on the initial blank page, placing the header content on the initial blank page;
s912, placing the footer content on the initial blank page according to the footer position on the initial blank page to obtain an intermediate file data stream;
and S914, generating a new blank page based on the intermediate file data stream.
The enterprise data further comprises page content data corresponding to the new blank page, the page content data corresponding to the new blank page is provided with data dimensions, and the page content data corresponding to the new blank page further comprises dimension data on each data dimension. And the data dimensions include a first level dimension and a second level dimension.
And S916, judging whether corresponding dimension data exist in each second-level dimension.
S918, if the first level dimension does not exist, inserting the text data corresponding to the first level dimension into the new blank page as a title text.
And S920, if the text data exists, using the text data corresponding to the data dimension as a title text, and setting a title style of the title text.
And S922, inserting the title text into the new blank page according to the title style.
And S924, in response to the line feed instruction, inserting the dimension data on each data dimension into the new blank page according to a preset pattern.
The new blank page comprises a back cover page, and the page content data corresponding to the new blank page comprises a back cover picture.
S926, placing the back cover picture on the upper layer of the back cover page, wherein the back cover picture covers the preset range of the back cover page, and obtaining a report file data stream.
And S930, generating a target report file according to the report file data stream.
It should be understood that, although the steps in the above-described flowcharts 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 a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
In one embodiment, as shown in fig. 9, there is provided a report file generating apparatus 900 including: a file data obtaining module 910, a first filling module 920, a second filling module 930, and a report file generating module 940, wherein:
a file data obtaining module 910, configured to obtain enterprise data and an initial file data stream, where the initial file data stream includes an initial blank page, and the enterprise data includes page content data corresponding to the initial blank page;
a first filling module 920, configured to fill the page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generate a new blank page based on the intermediate file data stream, where the enterprise data further includes page content data corresponding to the new blank page;
a second filling module 930, configured to fill the page content data corresponding to the new blank page into the new blank page, so as to obtain a report file data stream;
and a report file generating module 940, configured to generate a target report file according to the report file data stream.
In one embodiment, the apparatus further comprises a generation request acquisition module and an enterprise data lookup module, wherein:
the generating request acquisition module is used for acquiring a generating request of the report file, wherein the generating request comprises a report type and an enterprise identifier;
and the enterprise data searching module is used for searching according to the report type and the enterprise identification to obtain the enterprise data.
In one embodiment, the initial blank page comprises a cover page, and the page content data corresponding to the initial blank page comprises a cover picture; the first filling module 920 is further configured to place the cover picture on the upper layer of the cover page, and the cover picture covers a preset range of the cover page, where the preset range is a partial region or a whole region of the cover page.
In one embodiment, the new blank page includes a back cover page, and the page content data corresponding to the new blank page includes a back cover picture; the first filling module 920 is further configured to place the back cover picture on an upper layer of the back cover page, where the back cover picture covers a preset range of the back cover page.
In one embodiment, the enterprise data further includes header data and footer data, the header data including header content, the footer data including footer content, the first populating module 920 further configured to place the header content on the initial blank page according to a header position on the initial blank page; and placing the footer content on the initial blank page according to the footer position on the initial blank page.
In an embodiment, the page content data corresponding to the new blank page is provided with a data dimension, and the second filling module 930 is further configured to use text data corresponding to the data dimension as a title text, and set a title style of the title text; and inserting the title text into the new blank page according to the title style.
In an embodiment, the page content data corresponding to the new blank page further includes dimension data in each data dimension, and the apparatus further includes a dimension data insertion module, configured to insert, in response to a linefeed instruction, the dimension data in each data dimension into the new blank page according to a preset pattern.
In one embodiment, the apparatus further comprises a presentation style detection module, a table generation module, and a chart generation module; wherein:
the presentation style detection module is used for detecting the presentation style of each dimension datum;
the table generation module is used for creating a table cell in the new blank page if the presentation style is a table style, acquiring corresponding cell data from the dimension data, and inserting the cell data into the cell;
and the chart generation module is used for creating a blank chart in the new blank page if the presentation style is a chart style, and binding the dimension data with the blank chart to generate a corresponding chart.
In one embodiment, the data dimensions include a first-level dimension and a second-level dimension, and the apparatus further includes a first-level data determining module, where the first-level data determining module is configured to determine whether corresponding dimension data exists in each of the second-level dimensions; if the new blank page does not exist, the text data corresponding to the first-level dimension does not need to be inserted into the new blank page as the title text
In one embodiment, the data dimensions include a first-level dimension and a second-level dimension, and the apparatus further includes a second-dimension data determining module configured to determine whether corresponding dimension data exists in each of the second-level dimensions; and if the new blank page does not exist, deleting the title text corresponding to the first-level dimension from the new blank page, wherein the title text corresponding to the first-level dimension is generated based on the text data corresponding to the first-level dimension.
In one embodiment, the page content data corresponding to the new blank page is provided with a data dimension, and the device further includes a third dimension data determination module, configured to determine whether corresponding dimension data exists in the data dimension; if the enterprise data does not exist in the data dimension, the text data corresponding to the data dimension is used as a title text, the title text and prompt text data are inserted into the new blank page, and the prompt text data are used for indicating that no enterprise data corresponding to the data dimension exists; or if the data dimension does not exist, the text data corresponding to the data dimension does not need to be inserted into the new blank page.
For the specific limitations of the report file generation apparatus, reference may be made to the above limitations of the report file generation method, which are not described herein again. The modules in the report file generation device can be wholly or partially 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 terminal, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device 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 and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a report file generation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 10 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 an embodiment, a computer device is provided, comprising a memory in which a computer program is stored and a processor, which when executing the computer program performs the method steps in the above embodiments.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the method steps of the above-mentioned embodiments. 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 (14)

1. A method for generating a report file, the method comprising:
acquiring enterprise data and an initial file data stream, wherein the initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page;
filling page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generating a new blank page based on the intermediate file data stream, wherein the enterprise data further comprises page content data corresponding to the new blank page;
filling the page content data corresponding to the new blank page to obtain a report file data stream;
and generating a target report file according to the report file data stream.
2. The method of claim 1, wherein prior to said obtaining the enterprise data and the initial file data stream, the method further comprises:
acquiring a generation request of a report file, wherein the generation request comprises a report type and an enterprise identifier;
and searching according to the report type and the enterprise identification to obtain the enterprise data.
3. The method of claim 1, wherein the initial blank page comprises a cover page, and the page content data corresponding to the initial blank page comprises a cover picture; the filling the page content data corresponding to the initial blank page into the initial blank page includes:
the cover picture is placed on the upper layer of the cover page, the cover picture covers the preset range of the cover page, and the preset range is the partial region or the whole region of the cover page.
4. The method of claim 3, wherein the new blank page comprises a back cover page, and the page content data corresponding to the new blank page comprises a back cover picture; the step of filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream includes:
and placing the back cover picture on the upper layer of the back cover page, wherein the back cover picture covers the preset range of the back cover page.
5. The method of claim 3 or 4, wherein the enterprise data further comprises header data and footer data, wherein the header data comprises header content, wherein the footer data comprises footer content, wherein the initial blank page has a header position and a footer position, and wherein populating the initial blank page with page content data corresponding to the initial blank page further comprises:
placing the header content on the initial blank page according to the header position on the initial blank page;
and placing the footer content on the initial blank page according to the footer position on the initial blank page.
6. The method according to claim 1, wherein the page content data corresponding to the new blank page has a data dimension, and the step of filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream includes:
taking the text data corresponding to the data dimension as a title text, and setting a title style of the title text;
and inserting the title text into the new blank page according to the title style.
7. The method of claim 6, wherein the page content data corresponding to the new blank page further includes dimension data in each of the data dimensions, and after the inserting the header text content into the new blank page, the method further comprises:
and responding to a line feed instruction, and inserting the dimension data on each data dimension into the new blank page according to a preset pattern.
8. The method of claim 7, wherein the inserting the dimension data in each data dimension into the new blank page according to a preset pattern comprises:
detecting a presentation style of each dimension datum;
if the presentation style is a table style, creating table cells in the new blank page, acquiring corresponding cell data from the dimension data, and inserting the cell data into the cells;
and if the presentation style is a chart style, creating a blank chart in the new blank page, and binding the dimension data with the blank chart to generate a corresponding chart.
9. The method of claim 6, wherein the data dimensions comprise a first-level dimension and a second-level dimension, and before the step of using the text data corresponding to the data dimensions as the header text, the method further comprises:
judging whether corresponding dimension data exist in each second-level dimension;
and if the first-level dimension does not exist, the text data corresponding to the first-level dimension does not need to be inserted into the new blank page as a title text.
10. The method of claim 6, wherein the data dimensions comprise a first-level dimension and a second-level dimension, and after the text data corresponding to the data dimensions is used as the title text, the method further comprises:
judging whether corresponding dimension data exist in each second-level dimension;
and if the new blank page does not exist, deleting the title text corresponding to the first-level dimension from the new blank page, wherein the title text corresponding to the first-level dimension is generated based on the text data corresponding to the first-level dimension.
11. The method according to claim 1, wherein the page content data corresponding to the new blank page is provided with a data dimension, and before the page content data corresponding to the new blank page is filled into the new blank page to obtain a report file data stream, the method further comprises:
judging whether corresponding dimension data exist in the data dimension;
if the enterprise data does not exist in the data dimension, the text data corresponding to the data dimension is used as a title text, the title text and prompt text data are inserted into the new blank page, and the prompt text data are used for indicating that no enterprise data corresponding to the data dimension exists; or
And if the data dimension does not exist, inserting the text data corresponding to the data dimension into the new blank page.
12. An apparatus for generating a report file, the apparatus comprising:
the file data acquisition module is used for acquiring enterprise data and an initial file data stream, wherein the initial file data stream comprises an initial blank page, and the enterprise data comprises page content data corresponding to the initial blank page;
a first filling module, configured to fill the page content data corresponding to the initial blank page to obtain an intermediate file data stream, and generate a new blank page based on the intermediate file data stream, where the enterprise data further includes page content data corresponding to the new blank page;
the second filling module is used for filling the page content data corresponding to the new blank page into the new blank page to obtain a report file data stream;
and the report file generation module is used for generating a target report file according to the report file data stream.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 11 when executing the computer program.
14. 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 11.
CN202110467668.7A 2021-04-28 2021-04-28 Report file generation method and device, computer equipment and storage medium Pending CN113268968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110467668.7A CN113268968A (en) 2021-04-28 2021-04-28 Report file generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110467668.7A CN113268968A (en) 2021-04-28 2021-04-28 Report file generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113268968A true CN113268968A (en) 2021-08-17

Family

ID=77229660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110467668.7A Pending CN113268968A (en) 2021-04-28 2021-04-28 Report file generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113268968A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN111178747A (en) * 2019-12-26 2020-05-19 金蝶征信有限公司 Enterprise portrait generation method and device, computer equipment and storage medium
CN111752899A (en) * 2020-06-28 2020-10-09 中科三清科技有限公司 Environment report generation method and device, electronic equipment and storage medium
CN112182201A (en) * 2020-11-10 2021-01-05 平安普惠企业管理有限公司 Rich text report generation method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN111178747A (en) * 2019-12-26 2020-05-19 金蝶征信有限公司 Enterprise portrait generation method and device, computer equipment and storage medium
CN111752899A (en) * 2020-06-28 2020-10-09 中科三清科技有限公司 Environment report generation method and device, electronic equipment and storage medium
CN112182201A (en) * 2020-11-10 2021-01-05 平安普惠企业管理有限公司 Rich text report generation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US11294968B2 (en) Combining website characteristics in an automatically generated website
CN108509400B (en) Document template generation method and device, computer equipment and storage medium
CN113076731A (en) Report file generation method and device, computer equipment and storage medium
CN104391725A (en) Page display method and page display device
CN106528587B (en) Page display method and device in composite webpage system
CN106648569B (en) Target serialization realization method and device
CN107391535B (en) Method and device for searching document in document application
CN103605502A (en) Form page display method and server
CN114417226A (en) Page generation method, display method, device, electronic equipment and storage medium
KR102087280B1 (en) Server for editing electronic document based on message including edit command and operating method thereof
US20120030557A1 (en) Method and apparatus of accessing and modifying the content of an electronic data form
KR102087274B1 (en) Web electric document editing apparatus for rendering object and operating method thereof
CN113268968A (en) Report file generation method and device, computer equipment and storage medium
CN115587247A (en) Method, device and equipment for monitoring user label and storage medium
US8578268B2 (en) Rendering electronic documents having linked textboxes
CN111414728B (en) Numerical data display method, device, computer equipment and storage medium
CN112149391B (en) Information processing method, information processing apparatus, terminal device, and storage medium
CN115145674A (en) Page jump method, device, equipment and medium based on dynamic anchor point
CN111382382B (en) Data display method, device, computer equipment and storage medium
CN109325160B (en) Webpage snapshot generating method and device
CN113297837A (en) PDF form information extraction method, device, equipment and storage medium
KR20120034525A (en) Apparatus and method for recommanding contents
CN113268585A (en) Report file generation method and device, computer equipment and storage medium
CN111352917A (en) Information input method and device, electronic equipment and storage medium
CN113377367B (en) Data collection method, device, computer equipment and storage medium

Legal Events

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