A report display method and device based on Excel

By obtaining preset data and configuration files of the report and using configuration files for pagination display, the problems of redundant code and poor user experience in the existing technology are solved, and the pagination display and flexible configuration of report data are realized, which improves the user experience and Code maintainability.

CN112100994BActive Publication Date: 2024-11-05CHINA CONSTRUCTION BANK
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011036106.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2024-11-05
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

In the prior art, the report generation method has problems such as redundant code and poor user experience. Hard-coded processing makes the code difficult to maintain, and data is directly displayed without processing, resulting in user visual fatigue, affecting work efficiency.

Method used

By obtaining the preset data and configuration files of the report, the configuration files are used for pagination display, including the configuration of the paging table header, data and table ends, splitting and grouping data according to the data volume, generating Excel paging tables, improving the readability and flexibility of the report sex.

Benefits of technology

It realizes pagination display of report data, improves readability and flexibility, avoids code redundancy, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112100994B_ABST
    Figure CN112100994B_ABST
Patent Text Reader

Abstract

The present invention provides a report display method and device based on Excel, the method comprising: obtaining preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and displaying the preset data by Excel paging according to the configuration file. The device is used to execute the above method. The report display method and device based on Excel provided by the embodiment of the present invention improve the flexibility of report data display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a report display method and device based on Excel. Background Art

[0002] With the continuous development of computer technology, the amount of business data interacted by users is increasing, and users' requirements for the visualization and experience of report data exported from the front end are also increasing.

[0003] In the prior art, in the generation of reports, data can be displayed after hard coding or directly displayed without processing. In the hard-coded processing method, the header and production method are fixed. Each scenario report has its own fixed header and style. The field name is written in the code, and the corresponding entity class is configured. The data queried from the database is assigned to the entity class, and then the EXCEL workbook object is created, and each row and column in EXCEL is looped to fill in the data list to form a report. The hard-coded processing method will make the code become more and more bulky. When modifying the code, it is necessary to find the corresponding code file, which is not flexible and fast enough, and it is not convenient for report maintenance. Data is displayed directly without processing. In the report display requirements of a large amount of data, all data is directly listed in the report. Users need to browse thousands or even tens of thousands of data. As time goes by, it will cause visual fatigue to users. If the user does not record a certain data, it is necessary to search for the data again, which takes a lot of time, thereby affecting work efficiency and poor user experience. Summary of the invention

[0004] In view of the problems in the prior art, an embodiment of the present invention provides an Excel-based report display method and device, which can at least partially solve the problems in the prior art.

[0005] On the one hand, the present invention provides a report display method based on Excel, comprising:

[0006] Acquire preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset;

[0007] The preset data is displayed in Excel pages according to the configuration file.

[0008] The configuration file includes a paging configuration, and the paging configuration includes a paging header configuration, a paging data configuration, and a paging footer configuration.

[0009] The configuration file also includes page header configuration and page footer configuration.

[0010] The preset data includes a plurality of grouped data; accordingly, displaying the preset data in Excel pages according to the configuration file includes:

[0011] According to the data volume of each group data and the paging table detail size set in the configuration file, the paging number of each group data is obtained, each group data is split into a plurality of sub-group data according to the paging number of each group data, and sub-group list data is established according to the plurality of sub-group data;

[0012] An Excel page table is generated according to the header data, the sub-group list data, the footer data and the corresponding configuration information; wherein the preset data includes the header data and the footer data.

[0013] Wherein, obtaining the number of pages of each data group according to the data amount of each data group and the data amount per page set in the configuration file comprises:

[0014] The quotient of the data volume of each group data and the data volume of each page is calculated and rounded up to obtain the number of pages of each group data.

[0015] Wherein, the configuration file is in XML file format.

[0016] In another aspect, the present invention provides an Excel-based report display device, comprising:

[0017] An acquisition unit, used to acquire preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset;

[0018] A display unit is used to display the preset data through Excel pages according to the configuration file.

[0019] Wherein, the display unit comprises:

[0020] an obtaining subunit, configured to obtain the number of pages of each group data according to the data volume of each group data and the size of the paging table details set in the configuration file, split each group data into a plurality of sub-group data according to the number of pages of each group data, and establish sub-group list data according to the plurality of sub-group data; wherein the preset data includes a plurality of group data;

[0021] A generating subunit is used to generate an Excel page table according to the page header data, the sub-grouping list data, the page footer data and the corresponding configuration information; wherein the preset data includes the page header data and the page footer data.

[0022] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the Excel-based report display method described in any of the above embodiments are implemented.

[0023] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the Excel-based report display method described in any of the above embodiments.

[0024] The Excel-based report display method and device provided in the embodiment of the present invention obtains the preset data of the report and the configuration file corresponding to the report, and then displays the preset data through Excel paging according to the configuration file, thereby realizing paging display of the report data and improving the readability of the report data. In addition, the display of the report data can be flexibly configured through the configuration file, avoiding the redundancy of the code and improving the flexibility of the display of the report data. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0026] Figure 1 It is a flowchart of a report display method based on Excel provided in one embodiment of the present invention.

[0027] Figure 2 It is a flowchart of an Excel-based report display method provided by another embodiment of the present invention.

[0028] Figure 3 It is a structural schematic diagram of an Excel-based report display device provided in one embodiment of the present invention.

[0029] Figure 4 It is a structural schematic diagram of an Excel-based report display device provided by another embodiment of the present invention.

[0030] Figure 5 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0032] Figure 1FIG. 1 is a flow chart of a report display method based on Excel provided in one embodiment of the present invention. Figure 1 As shown, the Excel-based report display method provided by the embodiment of the present invention includes:

[0033] S101, obtaining preset data of a report and a configuration file corresponding to the report;

[0034] Specifically, in order to display report data, the server can obtain preset data of the report and obtain a configuration file corresponding to the report. The configuration file is preset and corresponds to the report. Different configuration files can be set based on the type of report, and a corresponding relationship between the report and the configuration file is established. The preset data can be data for generating a report that is pre-exported from a database in a set format and has a format that matches the configuration file. The execution subject of the Excel-based report display method provided in the embodiment of the present invention includes but is not limited to a server.

[0035] S102: Display the preset data in Excel pages according to the configuration file.

[0036] Specifically, after obtaining the preset data of the report and the corresponding configuration file, the server can obtain corresponding data from the preset data according to the configuration in the configuration file, fill it into an Excel table, and display the preset data in pages.

[0037] The Excel-based report display method provided in the embodiment of the present invention obtains the preset data of the report and the configuration file corresponding to the report, and then displays the preset data through Excel paging according to the configuration file, thereby realizing paging display of the report data and improving the readability of the report data. In addition, the display of the report data can be flexibly configured through the configuration file, avoiding the redundancy of the code and improving the flexibility of the display of the report data.

[0038] On the basis of the above embodiments, further, the configuration file includes a paging configuration, and the paging configuration includes a paging header configuration, a paging data configuration, and a paging footer configuration.

[0039] Specifically, the configuration file includes a paging configuration, and the paging configuration includes a paging header configuration, a paging data configuration, and a paging footer configuration. Among them, the paging header configuration can set the paging header size, the relative row position of the header element, the column position of the header element, the font size, the font color, the prefix information, the header element data reading keyword and other information. The paging data configuration can set the paging table detail size, the relative row position of the paging table detail element, the column position of the paging table detail element, the font color, the paging table detail element data reading keyword and other information. The paging footer configuration can set the paging footer size, the relative row position of the footer element, the column position of the footer element, the font size, the font color, the footer element data reading keyword and other information, and the footer element data is such as a signature and date. Among them, the actual row position of the element = the actual starting position of the unit + the relative row position of the configured element, and the column position is an absolute position.

[0040] For example, in the paging header configuration, the header reading keyword is set to: account, the prefix information is: account:, and the header position is centered. When the server obtains data from the preset data, it queries account: customer XXX fund account, then it will obtain the customer XXX fund account as the paging header, and add the prefix account, and display it in the center of the Excel table page: Account: Customer XXX Fund Account.

[0041] For example, if the paging data volume is set to 20 data items / page in the paging data configuration, then when the preset data is displayed in pages, there are at most 20 data items per page.

[0042] On the basis of the above embodiments, further, the configuration file also includes a header configuration and a footer configuration.

[0043] Specifically, the configuration file may also include a header configuration and a footer configuration. The header configuration may set the header size, the relative row position of the header element, the column position of the header element, the font size, the font color, the header element data reading keyword and other information. The header element data may be, for example, a display serial number. The footer configuration may set the footer size, the relative row position of the footer element, the column position of the footer element, the font size, the font color, the footer element data reading keyword and other information. The footer element data may be, for example, information such as a print date. The specific settings of the header configuration and the footer configuration are set according to actual needs and are not limited in the embodiments of the present invention.

[0044] Figure 2 FIG. 1 is a flow chart of a report display method based on Excel provided in another embodiment of the present invention. Figure 2As shown, based on the above embodiments, further, the preset data includes a plurality of grouped data; accordingly, the preset data is displayed in Excel pages according to the configuration file, including:

[0045] S1021, obtaining the number of pages of each group data according to the data volume of each group data and the detailed size of the paging table set in the configuration file, splitting each group data into a plurality of sub-group data according to the number of pages of each group data, and establishing sub-group list data according to the plurality of sub-group data;

[0046] Specifically, the preset data includes a plurality of group data, each of which has a certain amount of data. The server can obtain the amount of data of each group data, and obtain the paging table detail size from the paging data configuration of the configuration file, and then calculate the number of pages of each group data according to the amount of data of each group data and the paging table detail size. Then, each group data is split into a corresponding number of sub-group data according to the number of pages of each group data, and a plurality of sub-group data can be obtained, wherein the number of groups of the plurality of sub-group data is equal to the sum of the number of pages of each group data, and then sub-group list data is established according to the plurality of sub-group data. Among them, the paging table detail size can be the number of data items displayed on each page.

[0047] For example, obtain a group data, divide the data volume of the group by the paging table size included in the configuration file, if it is divisible, then the number of pages of the group data = the data volume of the group data / the paging table size, if it is not divisible, then the number of pages of the group data = round up (the data volume of the group data / the paging table size). Process the group data in a loop and split it into the number of pages, which is not greater than the paging table size. Load the split sub-group data into a sub-group list. Process each group data in turn according to the same processing process as above, split each group data into corresponding sub-group data, and load it into the sub-group list until all the group data in the preset data are processed and the sub-group list data is obtained. Among them, each group data may include header data, table detail data and table footer data, and the table detail data is split during the splitting process, and the header data and table footer data remain unchanged and inherited to the sub-group data. The data volume of the group data refers to the data volume of the table detail data.

[0048] For example, the preset data of report A includes two groups, account 1 and account 2. Each group data includes header data, table detail data and footer data. The header data includes account name, currency and account number. The table detail data is account details, including debit and credit identification, amount, transaction date, and remarks. The footer data includes the account opening institution. The data volume of the table detail data of account 1 is 40, and the data volume of the table detail data of account 2 is 75. The paging data configuration corresponding to report A sets the paging table detail size to 10 items / page. Then the server can calculate that the number of pages for account 1 is 40 / 10=4, which is divisible, the number of pages for account 1 is 4, and the number of pages for account 2 is 75 / 10=7.5, which is not divisible, and the number of pages is rounded up to 8. Therefore, the table details of account 1 are divided into 4 sub-group data, and the size of these 4 sub-group data is 10. The table details of account 2 are divided into 8 sub-group data, and the size of the first 7 sub-group data is 10, and the size of the last sub-group data is 5. The 4 sub-group data of account 1 and the 8 sub-group data of account 2 constitute the sub-group list data, and the sub-group list data includes 12 sub-group data, and the size of each sub-group data is not more than 10. In the sub-group list data, the header data and footer data of the first 4 sub-group data are the header data and footer data of account 1, and the header data and footer data of the last 8 sub-group data are the header data and footer data of account 2.

[0049] 1022. Generate an Excel page table according to the header data, the sub-group list data, the footer data, and the corresponding configuration information; wherein the preset data includes the header data and the footer data.

[0050] Specifically, after obtaining the sub-group list data, the server can generate an Excel page header according to the page header data and the corresponding configuration information, generate each Excel page data according to the sub-group list data and the corresponding configuration information, and generate an Excel page footer according to the page footer data and the corresponding configuration information. The Excel page header, each page data and Excel page footer constitute an Excel page table. The configuration information corresponding to the page header data is stored in the page header configuration, the configuration information corresponding to the page footer data is stored in the page footer configuration, and the configuration information corresponding to the sub-group list data is stored in the page configuration.

[0051] The following is a specific example to illustrate the generation process of Excel paging table:

[0052] (1) Define a current row number position variable rowNo, with an initial value of 0, and a current page number variable pageNo, with an initial value of 0.

[0053] (2) Generate Excel header according to header configuration and header data.

[0054] (3) Obtain a sub-group data of the sub-group list data, first generate a page header, obtain relevant configuration information from the page header configuration and obtain the header data of the sub-group data, rowNo=pageNo×(page header size+page table detail size+page table footer size)+page header size, and the row number position of a cell in the header = rowNo+relative row number position of the header element configuration, column number position = column number position of the header element configuration, and the text content in the cell is the data value obtained by reading the keyword in the header data according to the configured header element data.

[0055] (4) Generate paging table details, obtain relevant configuration information from the paging data configuration and obtain the table details of the sub-grouped data, rowNo = pageNo × (page header size + page detail size + page footer size) + page header size + page header size, the row position of the cell in the paging table details = rowNo + the position of the paging table detail in the sub-grouped data, the column position = the column position of the paging table detail element configuration, and the text content in the cell is the data value obtained by reading the keyword in the table detail data according to the configured paging table detail element data.

[0056] (5) Generate a page footer, obtain relevant configuration information from the page footer configuration and obtain the footer data of the sub-group data, rowNo = pageNo × (page header size + page table detail size + page footer size) + page header size + page header size + page table detail size, the row position of the cell in the page footer = rowNo + the relative row position of the footer element configuration, the column position = the column position of the footer element configuration, and the text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data.

[0057] (6) Repeat steps (3) to (5) to sequentially process the remaining sub-group data of the sub-group list data to obtain corresponding paging data until the data processing in all sub-group list data is completed, that is, the paging processing is completed.

[0058] (7) Generate a footer, rowNo = (pageNo + 1) × (page header size + page table detail size + page footer size), and the row position of a cell in the footer = rowNo + the relative row position of the footer element configuration, the column position = the column position of the footer element configuration, and the text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data.

[0059] For example, the number of pages for account 1 of report A is 5 pages, and the number of pages for account 2 is 8 pages. The server will traverse the data of account 1 and fill it in a 5-page Excel table one by one, and then traverse the data of account 2 and fill it in an 8-page Excel table one by one, thereby displaying the preset data of report A on 13 pages.

[0060] In the configuration, the page header size is 5; the page header size is 5, of which the account element has 1 row and 1 column; the size is 10, of which the amount element has 3 columns; the page footer size is 5, of which the account opening institution element has 0 rows and 2 columns.

[0061] Then in the report page 2 belonging to account 2, the current page number is 5, among which the actual number of rows of account elements = 5×(page header size + page detail size + page footer size) + page header size + 1 = 106, and the number of columns is 1; the actual number of rows of amount elements in the third detail of the page = 5×(page header size + page detail size + page footer size) + page header size + page header size + 3 = 113, and the number of columns is 3; the actual number of rows of account opening institution elements = (5+1)×(page header size + page detail size + page footer size) + 0 = 120, and the number of columns is 2.

[0062] On the basis of the above embodiments, further, obtaining the number of pages of each group data according to the data amount of each group data and the data amount per page set in the configuration file includes:

[0063] The quotient of the data volume of each group data and the data volume of each page is calculated and rounded up to obtain the number of pages of each group data.

[0064] Specifically, the server divides the data volume of each packet data by the data volume of each page to obtain a quotient, and then rounds up the quotient to obtain the number of pages of each packet data.

[0065] For example, the server uses the formula Calculate the number of pages I for the jth group data j , D j is the data volume of the jth paging data, a is the data volume per page, Indicates rounding up.

[0066] On the basis of the above embodiments, the configuration file is in XML file format. The XML file is used to configure the display of different reports, and the display form of the report can be flexibly set by modifying the XML file to meet the differentiated needs of different businesses and improve the reusability and maintainability of the code.

[0067] The Excel-based report display method provided in the embodiment of the present invention displays report data in pages, making the report display more neat and concise, providing a good user experience, using XML files as public configuration files to improve the reusability and maintainability of the code, and using the configuration files to flexibly configure the header and paging page information to meet differentiated needs while having scalability.

[0068] Figure 3 : is a schematic diagram of the structure of an Excel-based report display device provided by an embodiment of the present invention, such as Figure 3 As shown, the Excel-based report display device provided in the embodiment of the present invention includes:

[0069] The acquisition unit 301 is used to acquire preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and the display unit 302 is used to display the preset data through Excel pages according to the configuration file.

[0070] Specifically, in order to display the report data, the acquisition unit 301 can acquire the preset data of the report and acquire the configuration file corresponding to the report. The configuration file is preset and corresponds to the report. Different configuration files can be set based on the type of report, and a corresponding relationship between the report and the configuration file is established. The preset data can be data for generating a report that is pre-exported from a database in a set format and has a format that matches the configuration file.

[0071] After obtaining the preset data of the report and the corresponding configuration file, the display unit 302 can obtain corresponding data from the preset data according to the configuration in the configuration file, fill in the data in an Excel table, and display the preset data in pages.

[0072] The Excel-based report display device provided in the embodiment of the present invention obtains the preset data of the report and the configuration file corresponding to the report, and then displays the preset data through Excel paging according to the configuration file, thereby realizing paging display of the report data and improving the readability of the report data. In addition, the display of the report data can be flexibly configured through the configuration file, avoiding the redundancy of the code and improving the flexibility of the display of the report data.

[0073] Figure 4 is a structural diagram of an Excel-based report display device provided by another embodiment of the present invention, such as Figure 4 As shown, based on the above embodiments, further, the display unit 302 includes an obtaining subunit 3021 and a generating subunit 3022, wherein:

[0074] The obtaining subunit 3021 is used to obtain the number of pages of each group data according to the data volume of each group data and the detailed size of the paging table set in the configuration file, split each group data into multiple sub-group data according to the number of pages of each group data, and establish sub-group list data according to the multiple sub-group data; wherein the preset data includes multiple group data; the generating subunit 3022 is used to generate an Excel paging table according to the page header data, the sub-group list data, the page footer data and the corresponding configuration information; wherein the preset data includes the page header data and the page footer data.

[0075] Specifically, the preset data includes a plurality of group data, each of which has a certain amount of data. The acquisition subunit 3021 can obtain the amount of data of each group data, and obtain the paging table detail size from the paging data configuration of the configuration file, and then calculate the number of pages of each group data according to the amount of data of each group data and the paging table detail size. Then, each group data is split into a corresponding number of sub-group data according to the number of pages of each group data, and a plurality of sub-group data can be obtained, wherein the number of groups of the plurality of sub-group data is equal to the sum of the number of pages of each group data, and then sub-group list data is established according to the plurality of sub-group data. Among them, the paging table detail size can be the number of data items displayed on each page.

[0076] After obtaining the sub-group list data, the generating sub-unit 3022 can generate the Excel page header according to the page header data and the corresponding configuration information, generate each page data of Excel according to the sub-group list data and the corresponding configuration information, and generate the Excel page footer according to the page footer data and the corresponding configuration information. The Excel page header, each page data and the Excel page footer constitute an Excel page table. The configuration information corresponding to the page header data is stored in the page header configuration, the configuration information corresponding to the page footer data is stored in the page footer configuration, and the configuration information corresponding to the sub-group list data is stored in the page configuration.

[0077] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0078] Figure 5 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 5As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 communicate with each other through the communication bus 504. The processor 501 may call the logic instructions in the memory 503 to execute the following method: obtaining preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and displaying the preset data through Excel paging according to the configuration file.

[0079] In addition, the logic instructions in the above-mentioned memory 503 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0080] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and displaying the preset data through Excel paging according to the configuration file.

[0081] The present embodiment provides a computer-readable storage medium, which stores a computer program. The computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and displaying the preset data through Excel paging according to the configuration file.

[0082] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0083] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0086] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0087] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A report display method based on Excel, characterized in that: include: Acquire preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; the preset data is data for generating a report that is pre-exported from a database in a set format; Displaying the preset data in Excel pages according to the configuration file; The preset data includes a plurality of grouped data; accordingly, displaying the preset data in Excel pages according to the configuration file includes: According to the data volume of each group data and the paging table detail size set in the configuration file, the paging number of each group data is obtained, each group data is split into a plurality of sub-group data according to the paging number of each group data, and sub-group list data is established according to the plurality of sub-group data; Generate an Excel page header according to the page header data and the corresponding configuration information, generate each page data of Excel according to the sub-group list data and the corresponding configuration information, generate an Excel page footer according to the page footer data and the corresponding configuration information, and the Excel page header, each page data and Excel page footer constitute an Excel paged table; The generation process of the Excel paging table includes: (1) Define a current row position variable rowNo, with an initial value of 0, and a current page number variable pageNo, with an initial value of 0; (2) Generate Excel header according to header configuration and header data; (3) Obtain a sub-group data of the sub-group list data, first generate a page header, obtain relevant configuration information from the page header configuration and obtain the header data of the sub-group data, rowNo = pageNo x (page header size + page table detail size + page table footer size) + page header size, and the row number position of a cell in the header = rowNo + the row number position configured by the header element, the column number position = the column number position configured by the header element, and the text content in the cell is the data value obtained by reading the keyword in the header data according to the configured header element data; (4) Generate paging table details, obtain relevant configuration information from the paging data configuration and obtain the table details of the sub-grouping data, rowNo = pageNo x (page table header size + page table details size + page table footer size) + page header size + page table header size, the row position of the cell in the paging table details = rowNo + the position of the paging table details in the sub-grouping data, the column position = the column position of the paging table detail element configuration, and the text content in the cell is the data value obtained by reading the keyword in the table detail data according to the configured paging table detail element data; (5) Generate a page footer, obtain relevant configuration information from the page footer configuration and obtain the footer data of the sub-group data, rowNo = pageNo x (page header size + page table detail size + page footer size) + page header size + page header size + page table detail size, the row position of the cell in the page footer = rowNo + the row position of the footer element configuration, the column position = the column position of the footer element configuration, the text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data; (6) Repeat steps (3) to (5) to sequentially process the remaining sub-group data of the sub-group list data to obtain corresponding paging data until the data processing in all the sub-group list data is completed, that is, the paging processing is completed; (7) Generate a footer, rowNo = (pageNo + 1) x (page header size + page table detail size + page footer size), and the row position of a cell in the footer = rowNo + the row position of the footer element configuration, and the column position = the column position of the footer element configuration. The text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data.

2. The method according to claim 1, characterized in that The configuration file includes a paging configuration, and the paging configuration includes a paging table header configuration, a paging data configuration, and a paging table footer configuration.

3. The method according to claim 2, characterized in that The configuration file also includes page header configuration and page footer configuration.

4. The method according to claim 1, characterized in that: The obtaining the number of pages of each data group according to the data amount of each data group and the data amount per page set in the configuration file comprises: The quotient of the data volume of each group data and the data volume of each page is calculated and rounded up to obtain the number of pages of each group data.

5. The method according to any one of claims 1 to 4, characterized in that: The configuration file is in XML file format.

6. A report display device based on Excel, characterized in that: include: An acquisition unit, used to acquire preset data of a report and a configuration file corresponding to the report; wherein the configuration file is preset; and the preset data is data for generating a report that is pre-exported from a database in accordance with a set format; A display unit is used to display the preset data in Excel pages according to the configuration file; the display unit includes: an obtaining subunit, configured to obtain the number of pages of each group data according to the data volume of each group data and the size of the paging table details set in the configuration file, split each group data into a plurality of sub-group data according to the number of pages of each group data, and establish sub-group list data according to the plurality of sub-group data; wherein the preset data includes a plurality of group data; A generating subunit is used to generate an Excel page header according to the page header data and the corresponding configuration information, generate each page data of Excel according to the sub-grouping list data and the corresponding configuration information, and generate an Excel page footer according to the page footer data and the corresponding configuration information. The Excel page header, each page data and the Excel page footer constitute an Excel page table; The generation subunit is specifically used for: (1) Define a current row position variable rowNo, with an initial value of 0, and a current page number variable pageNo, with an initial value of 0; (2) Generate Excel header according to header configuration and header data; (3) Obtain a sub-group data of the sub-group list data, first generate a page header, obtain relevant configuration information from the page header configuration and obtain the header data of the sub-group data, rowNo = pageNo x (page header size + page table detail size + page table footer size) + page header size, and the row number position of a cell in the header = rowNo + the row number position configured by the header element, the column number position = the column number position configured by the header element, and the text content in the cell is the data value obtained by reading the keyword in the header data according to the configured header element data; (4) Generate paging table details, obtain relevant configuration information from the paging data configuration and obtain the table details of the sub-grouping data, rowNo = pageNo x (page table header size + page table details size + page table footer size) + page header size + page table header size, the row position of the cell in the paging table details = rowNo + the position of the paging table details in the sub-grouping data, the column position = the column position of the paging table detail element configuration, and the text content in the cell is the data value obtained by reading the keyword in the table detail data according to the configured paging table detail element data; (5) Generate a page footer, obtain relevant configuration information from the page footer configuration and obtain the footer data of the sub-group data, rowNo = pageNo x (page header size + page table detail size + page footer size) + page header size + page header size + page table detail size, the row position of the cell in the page footer = rowNo + the row position of the footer element configuration, the column position = the column position of the footer element configuration, the text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data; (6) Repeat steps (3) to (5) to sequentially process the remaining sub-group data of the sub-group list data to obtain corresponding paging data until the data processing in all the sub-group list data is completed, that is, the paging processing is completed; (7) Generate a footer, rowNo = (pageNo + 1) x (page header size + page table detail size + page footer size), and the row position of a cell in the footer = rowNo + the row position of the footer element configuration, and the column position = the column position of the footer element configuration. The text content in the cell is the data value obtained by reading the keyword in the footer data according to the configured footer element data.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. 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 5 are implemented.

Citation Information

Patent Citations

  • Method and device for generating report

    CN105893634A

  • Report form realization method and device based on Excel template

    CN108268525A

  • Paging form data-processing method and system

    CN1936882A

  • Streamable interactive rendering-independent page layout

    US20080189602A1