Report generation method and device, computer equipment and readable storage medium
By using the pre -stored report library and data analysis tasks in the reporting system, automation generation reports solve the problem of low efficiency of traditional reporting methods, and realize the generation of rapid and automated statement.
Patent Information
- Application Number
- CN202411484229.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-28
AI Technical Summary
Traditional report generation methods rely on manual tabulation, which leads to very inefficient efficiency in the case of large data volume and complex report format.
By receiving a report request for the reporting user users, the target pre -stored statement is determined in the pre -stored statement based on the report attribute information. The pre -deposit statement is obtained by the data analysis task set on the database. Display the target pre -deposit report on the report preview page and receive the user's operating instructions to obtain the final target report.
The realization of automation and rapid generating users have been achieved, the efficiency of reporting has been improved, and the steps of artificial operation have been reduced.
Smart Images

Figure CN119378520A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a report generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of information technology, data analysis and report generation have become essential tasks in the daily operation and maintenance of enterprises. Generally speaking, reports can query and display data very intuitively. In the process of generating reports, data needs to be extracted from the database for processing and then filled into the report for display.
[0003] In traditional report generation methods, users need to manually determine the report format and filter the required data according to business needs, then manually add data cell by cell, and perform complex combination settings to create a report. However, as the amount of data increases day by day, the report format becomes more diverse and the structure becomes more complex, and the manual tabulation method becomes very inefficient. Summary of the invention
[0004] Based on this, it is necessary to provide a report generation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can automatically and quickly generate reports required by users in order to address the technical problem of low efficiency of manual tabulation mentioned above.
[0005] In a first aspect, the present application provides a report generation method, the method comprising:
[0006] Receiving a report generation request initiated by a target user, wherein the report generation request carries report attribute information;
[0007] Determining a target pre-stored report in a pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for a database;
[0008] The target pre-stored report is displayed on a report preview page, an operation instruction output by the target user based on the target pre-stored report is received, and the target report is acquired according to the operation instruction.
[0009] In one embodiment, the step of obtaining the pre-stored report includes:
[0010] If it is determined that a pre-stored report needs to be generated, extracting basic data required to generate the pre-stored report;
[0011] Performing data analysis and conversion on the basic data to obtain data to be filled;
[0012] The data to be filled is embedded in the report template corresponding to the pre-stored report to generate a pre-stored report.
[0013] In one embodiment, performing data analysis and conversion on the basic data to obtain the data to be filled includes:
[0014] Performing data preprocessing on the basic data to obtain preprocessed data;
[0015] Classifying the preprocessed data based on the report content of the pre-stored report to obtain at least one type of target data;
[0016] Input various target data into the corresponding visualization interface to obtain the visualized data to be filled.
[0017] In one embodiment, displaying the target pre-stored report on the report preview page includes:
[0018] The pre-stored report corresponding to the identity information of the target user is displayed on the report preview page.
[0019] In one embodiment, receiving the operation instruction output by the target user based on the target pre-stored report includes:
[0020] In the case where the target user's permission level is read-only, the operation instruction includes a selection instruction and a confirmation instruction;
[0021] When the target user's authority level is writable, the operation instruction includes an edit instruction, a download instruction, a selection instruction, and a confirmation instruction.
[0022] In one embodiment, the method further comprises:
[0023] When receiving an editing instruction output by the target user based on the target pre-stored report, the target report after the editing instruction is executed is saved and converted into a second file format for backup storage.
[0024] In a second aspect, the present application further provides a report generation device, the device comprising:
[0025] A receiving module, used to receive a report generation request initiated by a target user, wherein the report generation request carries report attribute information;
[0026] A determination module, used to determine a target pre-stored report in a pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for a database;
[0027] The display module is used to display the target pre-stored report on the report preview page, receive the operation instruction output by the target user based on the target pre-stored report, and obtain the target report according to the operation instruction.
[0028] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0030] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0031] The report generation method, apparatus, computer equipment, computer-readable storage medium and computer program product described above receive a report generation request initiated by a target user and carrying report attribute information, and then determine a target pre-stored report in a pre-stored report library based on the report attribute information. The pre-stored reports in the pre-stored report library are obtained by a data analysis task set for the database, and the target pre-stored report is displayed on a report preview page. Operation instructions output by the target user based on the target pre-stored report are received, and the target report is obtained according to the operation instructions. By automatically generating pre-stored reports based on data analysis of massive data in the database in advance, users can directly preview the target pre-stored reports on the report preview page, and then interactively explore the target pre-stored reports to obtain the desired target reports, which effectively improves the efficiency of report generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 An application environment diagram of a report generation method in an embodiment;
[0034] Figure 2 A flowchart of a report generation method in one embodiment;
[0035] Figure 3A schematic diagram of a flow chart of a step of determining a target pre-stored report in an embodiment;
[0036] Figure 4 A schematic diagram of a flow chart of a step of determining a target pre-stored report in another embodiment;
[0037] Figure 5 A schematic diagram of a flow chart of steps for receiving an operation instruction in one embodiment;
[0038] Figure 6 is a structural block diagram of a report generating device in one embodiment;
[0039] Figure 7 is an internal structure diagram of a computer device in one embodiment;
[0040] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] The report generation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, a terminal 102 and a server 104 may be involved at the same time. The terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be placed on a cloud or other network server. Specifically, the server 104 receives a report generation request initiated by a target user on the terminal 102, and the report generation request carries report attribute information; based on the report attribute information, a target pre-stored report is determined in a pre-stored report library; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for the database; the target pre-stored report is displayed on the report preview page of the terminal 102, an operation instruction output by the target user based on the target pre-stored report is received, and the target report is obtained according to the operation instruction and displayed on the terminal 102.
[0043] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0044] In an exemplary embodiment, Figure 2 As shown, a report generation method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps 202 to 206. Among them:
[0045] Step 202: receiving a report generation request initiated by a target user, wherein the report generation request carries report attribute information.
[0046] Among them, the reports described in this application are files that display data, such as report documents, dashboard display documents, invoices, receipts, news summary documents, etc. As long as they are report files used in scenarios where data needs to be displayed during the daily operation and maintenance management of the enterprise, they can all fall within the scope of the reports generated by this application.
[0047] Specifically, when there is a need for report generation, the target user can initiate a report generation request to the server side through his / her terminal. When initiating the report generation request, the report attribute information must be carried to characterize the specific content of the report to be generated, so as to automatically match the appropriate pre-stored report from the server database.
[0048] The report attribute information may include a scenario type, which is used to indicate the business scenario used by the report; it may also include report content, which is used to indicate the business content displayed in the report; it may also include a file format, which is used to indicate the file format in which the report is displayed.
[0049] Step 204, determining a target pre-stored report in the pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for the database.
[0050] In order to improve the efficiency of report generation, the server can set up data analysis tasks based on the massive data in the database or data warehouse to obtain pre-stored reports in advance for user query and preview, and generate the final target report based on this.
[0051] Specifically, the data analysis task can be to first extract the basic data required to generate a pre-stored report, and then combine the basic data with the corresponding report template to generate the pre-stored report. Therefore, the purpose of the data analysis task is to obtain the pre-stored report, and then the task type can be set according to the type of pre-stored report to be obtained. For example, when the pre-stored report to be obtained is an invoice for a certain business scenario, the basic data required to generate the invoice can be first extracted from the data warehouse according to the business scenario, and then the basic data can be combined with the invoice template to obtain the pre-stored report.
[0052] Exemplarily, a data analysis task may be set with a corresponding start condition to update the pre-stored report generated by the data analysis task. The start condition may be, for example, a timed start condition, that is, when the timed duration indicated by the timed start condition is reached, the data analysis task is started to obtain the corresponding pre-stored report. The start condition may also be, for example, a data update start condition, that is, when the user inputs or other data sources input relevant new data into the database, the data analysis task is started to obtain the corresponding pre-stored report.
[0053] It can be understood that for static data sources, that is, data that will not change within a period of time, the pre-stored reports can be updated by setting timed start conditions for the relevant data analysis tasks. For dynamic data sources, that is, data that may change at any time, such as data obtained from an API interface or data stored in a database, the pre-stored reports can be updated by setting data update start conditions for the relevant data analysis tasks.
[0054] In this embodiment, by setting data analysis tasks, database data is automatically filled into predefined report templates, so that pre-stored reports can automatically reflect the latest data analysis results without manual updates. When the target report is obtained based on the pre-stored report, the report generation efficiency is effectively improved.
[0055] For example, a data analysis tool may be installed in the server, and a corresponding data analysis processing interface may be provided to implement the data analysis task. Specifically, after the corresponding start condition is met, the data analysis processing interface may be called to automatically extract and process data, analyze and generate reports.
[0056] For example, each pre-stored report in the pre-stored report library may also correspond to a target user list, that is, the target users in the target user list need to use the pre-stored report. Then, when the data analysis task corresponding to the pre-stored report is started and executed, after the latest pre-stored report is updated, the updated pre-stored report can be automatically distributed to the terminals to which the target users in the target user list belong, so as to realize automatic update and scheduling of the report.
[0057] Furthermore, after obtaining the report attribute information according to the report generation request initiated by the target user, the pre-stored report library can be searched according to the report attribute information to match and determine the target pre-stored report. It can be understood that when generating pre-stored reports, they are based on their business scenarios and business content. Then, when searching, the target pre-stored report that meets the requirements can be quickly determined according to the corresponding attribute information.
[0058] Step 206: display the target pre-stored report on the report preview page, receive an operation instruction output by the target user based on the target pre-stored report, and obtain the target report according to the operation instruction.
[0059] Specifically, after the corresponding target pre-stored report is found, it can be sent to the terminal to which the target user belongs, so that the target pre-stored report can be displayed on the report preview page of the terminal.
[0060] It is understood that the target pre-stored report determined in the pre-stored report library based on the report attribute information may be one or multiple target pre-stored reports. Furthermore, when multiple target pre-stored reports are obtained, multiple report preview pages may be created on the terminal to which the target user belongs to display multiple corresponding target pre-stored reports.
[0061] Furthermore, after the target pre-stored report is displayed, the target user may operate the target pre-stored report through the input device of his terminal to feedback the operation instruction to the server, so that the server generates the final target report according to the operation instruction.
[0062] Among them, the types of operation instructions are not unique, and may include edit instructions, download instructions, select instructions, save instructions, save as instructions and confirm instructions, etc. It can be understood that the edit instruction is an instruction obtained by editing and modifying the report content in the target pre-stored report, the download instruction is an operation instruction for copying or downloading the target pre-stored report to the storage space specified by the user terminal, the select instruction is an operation instruction for selecting multiple target pre-stored reports as the target report, the save instruction is an operation instruction for saving the content of the currently edited target pre-stored report; the save as instruction is an operation instruction for saving the currently edited target pre-stored report in another file format; the confirm instruction is an operation instruction for confirming the current version of the target pre-stored report as the target report.
[0063] The above report generation method receives a report generation request with report attribute information initiated by a target user, and then determines a target pre-stored report in a pre-stored report library based on the report attribute information. The pre-stored reports in the pre-stored report library are obtained by a data analysis task set for the database, and the target pre-stored report is displayed on a report preview page. The target user receives an operation instruction based on the target pre-stored report output, and the target report is obtained according to the operation instruction. By automatically generating pre-stored reports based on data analysis of massive data in the database in advance, users can directly preview the target pre-stored report on the report preview page, and then interactively explore the target pre-stored report to obtain the desired target report, which effectively improves the efficiency of report generation.
[0064] In an exemplary embodiment, Figure 3 As shown, the step of obtaining the pre-stored report includes steps 302 to 306, wherein:
[0065] Step 302: if it is determined that a pre-stored report needs to be generated, basic data required for generating the pre-stored report is extracted.
[0066] Specifically, the data analysis tasks corresponding to the pre-stored reports all have corresponding start conditions, and the server can determine whether to execute the data analysis task according to the start conditions to generate the pre-stored reports. If it is determined that the start conditions of a data analysis task are met, it can be determined that the pre-stored report corresponding to the data analysis task needs to be generated.
[0067] Furthermore, the basic data required for generating a pre-stored report may be extracted first, and then the pre-stored report may be generated based on the combination of the basic data and the corresponding report template. The basic data may be extracted from the database by determining keywords such as query fields, query conditions, sorting methods, and paging information according to the business scenario and business content of the pre-stored report, and used to match the basic data in the database in a single or combined manner. For example, when the pre-stored report to be obtained is an invoice for a certain business scenario, the data keywords under the business scenario may be determined according to the business scenario, such as income and expenditure accounts, and then the basic data related to income and expenditure accounts may be extracted from the data warehouse according to the keyword (income and expenditure accounts), so that the basic data can be combined with the invoice template to obtain the pre-stored report.
[0068] Step 304: perform data analysis and conversion on the basic data to obtain data to be filled.
[0069] It is understandable that the basic data obtained in the database may not be suitable for the report template. Therefore, it is necessary to perform data analysis and conversion on the basic data to obtain data to be filled in that is suitable for the report template. The data analysis and conversion can be performed by first preprocessing the data and then converting the data format to form data that can be directly filled in the report template.
[0070] In an exemplary embodiment, Figure 4 As shown, step 304 includes steps 402 to 406, wherein:
[0071] Step 402: preprocess the basic data to obtain preprocessed data.
[0072] Specifically, the data preprocessing performed on the basic data may be to clean invalid data, supplement the missing data, or normalize the obviously inconsistent data. The method of data preprocessing may be determined according to the actual preprocessing means, and is not limited. For example, the method of cleaning invalid data may be to use commonly used interpolation methods or substitution methods.
[0073] Step 404: classify the preprocessed data based on the report content of the pre-stored report to obtain at least one type of target data.
[0074] Specifically, based on the needs of different report types, such as e-government, OA, official document system, ERP, CRM, contract management, archive management, etc., the data types contained therein can be various, such as common text, charts, maps and dashboards, etc. Furthermore, before combining the pre-processed basic data with the corresponding report template, the pre-processed basic data can be classified based on the report content of the pre-stored report to know what data form should be embedded in the report template.
[0075] Furthermore, the preprocessed basic data may first be determined to correspond to the filling position to be embedded in the report template, and then the basic data may be used as the target data under the data type required for the filling position. It can be understood that after all the preprocessed data are classified according to the above method, multiple classified target data sets may be obtained, and the data in each set belongs to the same data type.
[0076] Step 406, inputting various target data into corresponding visualization interfaces to obtain visualized data to be filled.
[0077] Specifically, the server is installed with data analysis tools, which usually include rich data visualization functions and provide corresponding data analysis processing interfaces to implement data analysis tasks. Among them, for visualization data such as charts, maps and dashboards, their data analysis processing interfaces can also be collectively referred to as visualization interfaces, which are used to output visualization data such as charts, maps and dashboards based on input data.
[0078] Furthermore, after obtaining various target data, the target data to be visualized can be input into the corresponding visualization interface to obtain the visualized data to be filled. For example, for image-type target data, it can be input into the pictorial interface to obtain the data to be filled in the form of images. For table-type target data, it can be input into the tabular interface to obtain the data to be filled in the form of a table.
[0079] Among them, for commonly used text-based basic data, there is no need to perform visualization operations, and it can be directly combined with the report template as data to be filled.
[0080] Step 306: embed the data to be filled into the report template corresponding to the pre-stored report to generate the pre-stored report.
[0081] Specifically, after obtaining various types of data to be filled, they can be embedded into the report template corresponding to the pre-stored report according to the corresponding filling position, so as to obtain the pre-stored report.
[0082] In an exemplary embodiment, displaying a target pre-stored report on a report preview page includes: displaying a pre-stored report corresponding to the identity information of the target user on the report preview page.
[0083] Before the target user initiates a report generation request to the server through his / her terminal, he / she needs to authenticate his / her identity information to the service side. That is, he / she sends an access request with his / her identity information to the service side. The server side determines his / her permission level based on his / her identity information and opens the access content corresponding to the permission level of the target user in response to the access request.
[0084] Specifically, after the target user initiates a report generation request to the server through his / her terminal, the server can determine the display range of the pre-stored report based on his / her authority level, and display the displayable report part on the report preview page.
[0085] In an exemplary embodiment, Figure 5 As shown, the receiving of the operation instruction of the target user based on the target pre-stored report output in step 206 includes steps 502 to 504, wherein:
[0086] Step 502: When the target user's authority level is read-only, the operation instruction includes a selection instruction and a confirmation instruction.
[0087] Specifically, the server can determine that the target user's permission level is read-only based on the target user's identity information, that is, the user can only browse the target pre-stored report, and determine the target pre-stored report as the target report. Alternatively, in the case where there are multiple target pre-stored reports, the target user of the read-only level can also perform a selection operation among the multiple target pre-stored reports and determine which target pre-stored report is used as the target report.
[0088] Step 504, when the target user's authority level is writable, the operation instruction includes an edit instruction, a download instruction, a selection instruction and a confirmation instruction.
[0089] Specifically, the server can determine that the target user's permission level is writable based on the target user's identity information, that is, the user can not only browse the target pre-stored report, but also edit and modify the target pre-stored report, and then determine the edited target pre-stored report as the target report. Similarly, in the case where there are multiple target pre-stored reports, the target user with a writable level can also perform a selection operation among the multiple target pre-stored reports and determine which target pre-stored report is used as the target report.
[0090] For example, other permission levels may be determined based on the target user's identity information to restrict the target user from performing other operation instructions. For example, under certain permission levels, the target user may also execute a save instruction and a save as instruction to change the content of the current pre-stored report.
[0091] It can be understood that the edit instruction is an instruction obtained by editing and modifying the report content in the target pre-stored report, the download instruction is an operation instruction for copying or downloading the target pre-stored report to the storage space specified by the user terminal, the selection instruction is an operation instruction for selecting multiple target pre-stored reports as the target report, the save instruction is an operation instruction for saving the content of the currently edited target pre-stored report; the save as instruction is an operation instruction for saving the currently edited target pre-stored report as another file format; the confirmation instruction is an operation instruction for confirming the current version of the target pre-stored report as the target report.
[0092] In an exemplary embodiment, the report generation method further includes: upon receiving an editing instruction from a target user based on a target pre-stored report output, saving the target report after the editing instruction is executed, and converting it into a second file format for backup storage.
[0093] It can be understood that as long as an editing instruction based on the target pre-stored report output by the target user is received, a save instruction and a save as instruction are executed once to achieve the real-time performance of the target report.
[0094] Specifically, the corresponding receiving address can be set for the save instruction first, that is, which address interface is responsible for receiving and processing the file stream uploaded by the save control when saving. Then, in the pointed address interface, a first file object for receiving the target report is created to save the target report to the file object after the edit instruction is executed. The file format of the first file object is the first file format, which is the same as the file format of the target report.
[0095] Furthermore, a second file object for receiving the target report needs to be created in the pointed address interface, so that the target report is converted into a second file format and stored in the file object after the editing instruction is executed. It can be understood that the file format of the second file object is the second file format, which is different from the file format of the target report.
[0096] Exemplarily, the second file format may be a PDF format. In this embodiment, it is recommended to convert the target document into a PDF format for online preview to ensure good compatibility on most browsers and platforms.
[0097] In a specific embodiment, a report generation method is provided, which adopts the technology of combining online preview of pageOffice reports with modern data analysis tools, and is suitable for business scenarios such as online document processing, automated report generation, complex report design, master-slave reports, intelligent question and answer and report generation. For example, automated report generation can be achieved: data is automatically extracted from the database and filled into the report template to generate the final report or dashboard. Invoice and document printing can also be achieved: order data is filled in the invoice or document template to achieve automated printing. Web content management can also be achieved: dynamically generate web page content, such as user dashboards or news summaries. This can be achieved through data integration and processing, dynamic data filling, online preview and editing, data visualization, intelligent report generation, security and authority management, and report automation and scheduling technology.
[0098] Specifically, in this method, pageOffice can be integrated into a modern data analysis platform to achieve data extraction and processing through an API interface. This allows users to open and edit Word and Excel documents directly in the browser. At the same time, data analysis tools can extract data from databases or data warehouses, perform necessary cleaning and conversion to adapt to report templates. The data set processed by the analysis tool can then be filled into the predefined report template, which allows the report to automatically reflect the latest data analysis results without manual updates. Among them, data analysis tools usually include rich data visualization functions, such as charts, maps, and dashboards, which can embed data visualization results into reports and provide more intuitive data presentation. In addition, data analysis tools can set automated tasks to run data analysis and generate reports regularly. pageOffice can be configured to automatically open and display the latest reports when these tasks are completed, so as to achieve automatic update and distribution of reports.
[0099] Furthermore, pageOffice provides a true Word and Excel editing experience, and users can edit and preview reports in real time in the browser. Combined with modern data analysis tools, users can interactively explore data and adjust reports to obtain the required analytical data. In addition, since report generation is combined with artificial intelligence technologies such as natural language processing and machine learning, users can use natural language queries to guide data analysis tools to generate specific reports, and pageOffice is responsible for presenting these reports in the form of Word or Excel.
[0100] Furthermore, when using pageOffice to edit Office files online, you can save a PDF file each time you save a file. In this way, the contents of the PDF file and the Office file are always completely synchronized. Implement pageOffice to edit Office online. In the backend, write code to assign a value to the SaveFilePage property before calling the webOpen method to open the file, that is, set which address interface is responsible for receiving and processing the file stream uploaded by the control when saving. Then, in the address interface pointed to by the SaveFilePage property, create a FileSaver to save the Office file opened online and the saved PDF file separately.
[0101] Key backend code, for example:
[0102] PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
[0103] poCtrl.setSaveFilePage("saveFile"); / / Set the interface address for saving files
[0104] poCtrl.webOpen("doc / test.docx", OpenModeType.docNormalEdit, "XXX"); / / Open the file
[0105] The front-end uses AddCustomToolButton to add a custom save button to save the file and save it as a PDF file at the same time. For example, the key front-end code is:
[0106] function SaveFile() {
[0107] pageofficectrl.WebSave(); / / Save the current file
[0108] pageofficectrl.WebSaveAsPDF(); / / Save the current file as PDF format
[0109] }
[0110] OnPageOfficeCtrlInit() {
[0111] / / PageOffice initialization event callback function
[0112] pageofficectrl.AddCustomToolButton("Save", "SaveFile()", 1);
[0113] }
[0114] In addition, pageOffice supports role-based permission management and can be integrated with the permission system of data analysis tools to ensure that users can only access and edit the report parts they are authorized to.
[0115] For example, when users need to preview Office documents online, they only need to integrate and call the PDFCtrl component of pageOffice to open the PDF file online. If you also want to allow users to browse the file content but not download and save the file, you can set the AllowCopy property of the pdfCtrl object to false to prohibit the copying of the file content. In this way, users can only view the file online, but cannot obtain the download address of the file, nor can they save the PDF file locally, thus achieving safe browsing of the file. Key code example:
[0116] PDFCtrl pdfCtrl = new PDFCtrl(request);
[0117] pdfCtrl.setAllowCopy(false); / / Prohibit copying
[0118] pdfCtrl.webOpen("D:\\documents\\test.pdf");
[0119] / / Linux server adds prefix: file: / /
[0120] / / pdfCtrl.webOpen("file: / / "+" / root / documents / test.pdf");
[0121] In this embodiment, through the combination of pageOffice report online preview and modern data analysis tools, the report can be automatically generated, updated in real time and interactively explored, improving the efficiency and value of the report. At the same time, in terms of performance, when processing large files, PageOffice's performance is better than traditional online preview technology, and it loads and renders faster. It supports operating systems such as Windows, Linux, Unix, as well as a variety of Web servers and Office software, enabling it to run in different environments. Users can open and edit documents directly in the browser without downloading them locally, which improves work efficiency. All document operations are performed on the server, and documents are not uploaded to the cloud, ensuring the security and confidentiality of the data. This method provides a very concise API, which is convenient for integration into existing management software systems without the need for complex API interfaces. It is recommended to convert documents to PDF format for online preview to ensure good compatibility on most browsers and platforms.
[0122] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0123] Based on the same inventive concept, the embodiment of the present application also provides a report generation device for implementing the report generation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more report generation device embodiments provided below can refer to the limitations on the report generation method above, and will not be repeated here.
[0124] In an exemplary embodiment, Figure 6 As shown, a report generation device is provided, including: a receiving module 610, a determining module 620 and a display module 630, wherein:
[0125] The receiving module 610 is used to receive a report generation request initiated by a target user, where the report generation request carries report attribute information;
[0126] The determination module 620 is used to determine a target pre-stored report in the pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for the database;
[0127] The display module 630 is used to display the target pre-stored report on the report preview page, receive an operation instruction output by the target user based on the target pre-stored report, and obtain the target report according to the operation instruction.
[0128] In an exemplary embodiment, the report generating device further includes:
[0129] The pre-stored module is used to extract the basic data required for generating the pre-stored report when it is determined that the pre-stored report needs to be generated; perform data analysis and conversion on the basic data to obtain the data to be filled; embed the data to be filled into the report template corresponding to the pre-stored report to generate the pre-stored report.
[0130] In an exemplary embodiment, the pre-stored module is also used to perform data pre-processing on basic data to obtain pre-processed data; classify the pre-processed data based on the report content of the pre-stored report to obtain at least one category of target data; input each category of target data into the corresponding visualization interface to obtain the visualized data to be filled.
[0131] In an exemplary embodiment, the display module 630 is further configured to display a pre-stored report corresponding to the identity information of the target user on the report preview page.
[0132] In an exemplary embodiment, the display module 630 is also used to, when the target user's authority level is read-only, the operation instructions include selection instructions and confirmation instructions; when the target user's authority level is writable, the operation instructions include editing instructions, downloading instructions, selection instructions and confirmation instructions.
[0133] In an exemplary embodiment, the report generating device further includes:
[0134] The saving module is used to save the target report after the editing instruction is executed and convert it into a second file format for backup storage when receiving the editing instruction output by the target user based on the target pre-stored report.
[0135] Each module in the above-mentioned report generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0136] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pre-stored reports and operation instruction data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a report generation method is implemented.
[0137] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a report generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0138] Those skilled in the art will understand that Figure 7 and Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0139] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented:
[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0141] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0143] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0144] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A report generation method, characterized in that: The method comprises: Receiving a report generation request initiated by a target user, wherein the report generation request carries report attribute information; Determining a target pre-stored report in a pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for a database; The target pre-stored report is displayed on a report preview page, an operation instruction output by the target user based on the target pre-stored report is received, and the target report is acquired according to the operation instruction.
2. The method according to claim 1, characterized in that: The steps to obtain a stored report include: If it is determined that a pre-stored report needs to be generated, extracting basic data required to generate the pre-stored report; Performing data analysis and conversion on the basic data to obtain data to be filled; The data to be filled is embedded in the report template corresponding to the pre-stored report to generate a pre-stored report.
3. The method according to claim 2, characterized in that The step of performing data analysis and conversion on the basic data to obtain the data to be filled includes: Performing data preprocessing on the basic data to obtain preprocessed data; Classifying the preprocessed data based on the report content of the pre-stored report to obtain at least one type of target data; Input various target data into the corresponding visualization interface to obtain the visualized data to be filled.
4. The method according to any one of claims 1 to 3, characterized in that: The target stored report displayed on the report preview page includes: The pre-stored report corresponding to the identity information of the target user is displayed on the report preview page.
5. The method according to claim 4, characterized in that Receiving an operation instruction output by the target user based on the target pre-stored report includes: In the case where the target user's permission level is read-only, the operation instruction includes a selection instruction and a confirmation instruction; When the target user's authority level is writable, the operation instruction includes an edit instruction, a download instruction, a selection instruction, and a confirmation instruction.
6. The method according to claim 5, characterized in that The method further comprises: When receiving an editing instruction output by the target user based on the target pre-stored report, the target report after the editing instruction is executed is saved and converted into a second file format for backup storage.
7. A report generation device, characterized in that: The device comprises: A receiving module, used to receive a report generation request initiated by a target user, wherein the report generation request carries report attribute information; A determination module, used to determine a target pre-stored report in a pre-stored report library based on the report attribute information; the pre-stored reports in the pre-stored report library are obtained by a data analysis task set for a database; The display module is used to display the target pre-stored report on the report preview page, receive the operation instruction output by the target user based on the target pre-stored report, and obtain the target report according to the operation instruction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.