Excel table display method, device and storage medium
Patent Information
- Application Number
- CN202310675399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-06-07
AI Technical Summary
[0005]本申请提供一种Excel表格的展示方法、设备及存储介质,用以解决处理效率低且准确率低的技术问题
[0057] The Excel spreadsheet display method, device, and storage medium provided in this application acquire the Excel spreadsheet to be displayed, determine the source data based on the Excel spreadsheet, determine the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determine the header style of the header data on the target display page based on the header names, and render and generate the target display page based on the header style and table content data to display the Excel spreadsheet. This method automatically determines the header style of the Excel spreadsheet on the target display page by classifying the headers according to the corresponding header data of the Excel spreadsheet, performing completion, merging, and deduplication processing based on the header array with the most rows, and rendering and generating the target display page based on the header style and table content data. It eliminates the need for manually pre-setting the table style or hardcoding the headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel spreadsheet, reducing manpower and time costs, reducing the probability of mismatch between header data and table content data, and achieving the technical effect of improving processing efficiency and accuracy.
Smart Images

Figure CN116720016B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data, and in particular to a method, device and storage medium for displaying Excel spreadsheets. Background Technology
[0002] With the continuous development of computer technology, the amount and types of business data required for user interaction are increasing day by day, and users' demand for online visualization of Excel spreadsheet data exported from the front end is also increasing.
[0003] In existing technologies, developers often use the ExcelJs module to convert data in an Excel spreadsheet into Hyper Text Markup Language (HTML) for display on a web page. This requires manually calling the relevant Application Programming Interface (API) and setting the header style of the Excel spreadsheet by setting field names, display width, and other preset parameters.
[0004] Existing methods for displaying Excel spreadsheets require developers to have knowledge of web page design and layout. They must pre-set the header style and related fields for each Excel spreadsheet display and then set the corresponding fields on the backend. Without setting header styles or corresponding fields on the frontend and backend, Excel spreadsheets cannot be displayed on web pages, which is time-consuming. Furthermore, the header styles set by developers may not be compatible with the content of the Excel spreadsheet to be displayed. Existing methods for displaying Excel spreadsheets suffer from low processing efficiency and low accuracy. Summary of the Invention
[0005] This application provides a method, device, and storage medium for displaying Excel spreadsheets to solve the technical problems of low processing efficiency and low accuracy.
[0006] On the one hand, this application provides a method for displaying an Excel spreadsheet, the method including:
[0007] Obtain the Excel spreadsheet to be displayed, and determine the source data based on the Excel spreadsheet;
[0008] The table header data and table content data are determined based on the source data; the table header data includes multiple table header arrays; each table header array includes multiple table header names;
[0009] The header style of the header data on the target display page is determined based on the header name;
[0010] Based on the header style and table content data, the target display page is rendered to show the Excel spreadsheet.
[0011] Optionally, the header style of the header data in the target display page is determined based on the header name, including:
[0012] Determine if the header names in each header array are the same;
[0013] If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; where the base header array occupies N rows in the target display page, and N is a positive integer;
[0014] The header style of each header array in the header data on the target display page is determined based on the baseline header array; wherein, each header array in the header data occupies the same height on the target display page.
[0015] Optionally, the header style of each header array in the header data on the target display page is determined based on the baseline header array, including:
[0016] Based on the baseline header array, each header array is padded to ensure that each header array occupies N rows on the target display page and that each header array occupies the same height on the target display page.
[0017] Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row. The height of the row occupied by the merged M identical header names is the same as the height occupied by the M identical header names before merging, so that each header array occupies the same height on the target display page.
[0018] The table header names in a row containing M identical header names after merging are deduplicated so that each row contains only one header name, and the header style in the target display page is determined.
[0019] Optionally, based on the baseline header array, each header array is padded, including:
[0020] The corresponding header array is hierarchically processed based on the header name to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N;
[0021] Based on the header name corresponding to the L-level header and the base header array, the corresponding columns of the L-level header are completed so that the completed header array and the base header array both occupy N rows on the target display page, and the completed header array and the base header array occupy the same height on the target display page.
[0022] Optionally, deduplication is performed on the header names in a row containing the M identical header names after merging, including:
[0023] Determine the M header names in a single row that contains the M identical header names after merging;
[0024] Remove M-1 header names so that each row containing the M identical header names after merging includes only one header name.
[0025] Optionally, before determining the number of rows occupied by the header names in each header array, the following is included:
[0026] The header data is formatted using a breadth-first traversal algorithm to ensure a consistent format.
[0027] Optionally, the method further includes:
[0028] If the header names in each header array are the same, a first-level header style that occupies one row on the target display page is generated based on the header name, and the first-level header style is determined as the header style of the header data on the target display page.
[0029] Secondly, this application provides an Excel spreadsheet display device, comprising:
[0030] The processing module is used to obtain the Excel spreadsheet to be displayed and determine the source data based on the Excel spreadsheet;
[0031] The first determining module is used to determine the header data and table content data based on the source data; wherein, the header data includes multiple header arrays; each header array includes multiple header names;
[0032] The second determination module is used to determine the header style of the header data in the target display page based on the header name;
[0033] The rendering module is used to render and generate the target display page based on the table header style and table content data to display the Excel spreadsheet.
[0034] Optionally, the second determining module is also used for:
[0035] Determine if the header names in each header array are the same;
[0036] If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; where the base header array occupies N rows in the target display page, and N is a positive integer;
[0037] The header style of each header array in the header data on the target display page is determined based on the baseline header array; wherein, each header array in the header data occupies the same height on the target display page.
[0038] Optionally, the second determining module is also used for:
[0039] Based on the baseline header array, each header array is padded to ensure that each header array occupies N rows on the target display page and that each header array occupies the same height on the target display page.
[0040] Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row. The height of the row occupied by the merged M identical header names is the same as the height occupied by the M identical header names before merging, so that each header array occupies the same height on the target display page.
[0041] The table header names in a row containing M identical header names after merging are deduplicated so that each row contains only one header name, and the header style in the target display page is determined.
[0042] Optionally, the second determining module is also used for:
[0043] The corresponding header array is hierarchically processed based on the header name to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N;
[0044] Based on the header name corresponding to the L-level header and the base header array, the corresponding columns of the L-level header are completed so that the completed header array and the base header array both occupy N rows on the target display page, and the completed header array and the base header array occupy the same height on the target display page.
[0045] Optionally, the second determining module is also used for:
[0046] Determine the M header names in a single row that contains the M identical header names after merging;
[0047] Remove M-1 header names so that each row containing the M identical header names after merging includes only one header name.
[0048] Optionally, the second determining module is also used for:
[0049] The header data is formatted using a breadth-first traversal algorithm to ensure a consistent format.
[0050] Optionally, the second determining module is also used for:
[0051] If the header names in each header array are the same, a first-level header style that occupies one row on the target display page is generated based on the header name, and the first-level header style is determined as the header style of the header data on the target display page.
[0052] A third aspect of this application provides an Excel spreadsheet display device, comprising:
[0053] Processor and memory;
[0054] The memory stores the instructions that the computer executes;
[0055] The processor executes computer execution instructions stored in memory, causing the Excel spreadsheet display device to execute any of the Excel spreadsheet display methods in the first aspect.
[0056] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a method for displaying an Excel spreadsheet as described in any of the first aspects.
[0057] The Excel spreadsheet display method, device, and storage medium provided in this application acquire the Excel spreadsheet to be displayed, determine the source data based on the Excel spreadsheet, determine the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determine the header style of the header data on the target display page based on the header names, and render and generate the target display page based on the header style and table content data to display the Excel spreadsheet. This method automatically determines the header style of the Excel spreadsheet on the target display page by classifying the headers according to the corresponding header data of the Excel spreadsheet, performing completion, merging, and deduplication processing based on the header array with the most rows, and rendering and generating the target display page based on the header style and table content data. It eliminates the need for manually pre-setting the table style or hardcoding the headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel spreadsheet, reducing manpower and time costs, reducing the probability of mismatch between header data and table content data, and achieving the technical effect of improving processing efficiency and accuracy. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0059] Figure 1 The method flow for displaying an Excel spreadsheet provided in the embodiments of this application Figure 1 ;
[0060] Figure 2 The method flow for displaying an Excel spreadsheet provided in the embodiments of this application Figure 2 ;
[0061] Figure 3 A schematic diagram of the structure of the device for displaying the Excel spreadsheet provided in the embodiments of this application;
[0062] Figure 4 This is a hardware structure diagram of the device for displaying the Excel spreadsheet provided in the embodiments of this application.
[0063] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0065] As enterprises undergo digital and information-based transformation, the demand for online visualization of Excel spreadsheet data is increasing.
[0066] In existing technologies, manually displaying data from an Excel spreadsheet online requires not only manually calling relevant APIs but also pre-setting the header style of the Excel spreadsheet.
[0067] Existing methods for displaying Excel spreadsheets require significant manpower and time. Manually set header styles have a low compatibility with Excel content, resulting in a high error rate and technical problems such as low processing efficiency and low accuracy.
[0068] The Excel spreadsheet display method, device, and storage medium provided in this application acquire the Excel spreadsheet to be displayed, determine the source data based on the Excel spreadsheet, determine the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determine the header style of the header data on the target display page based on the header names, and render and generate the target display page based on the header style and table content data to display the Excel spreadsheet. This method automatically determines the header style of the Excel spreadsheet on the target display page by classifying the headers according to the corresponding header data of the Excel spreadsheet, performing completion, merging, and deduplication processing based on the header array with the most rows, and rendering and generating the target display page based on the header style and table content data. It eliminates the need for manually pre-setting the table style or hardcoding the headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel spreadsheet, reducing manpower and time costs, reducing the probability of mismatch between headers and table content, and achieving the technical effect of improving processing efficiency and accuracy.
[0069] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0070] Figure 1 The method flow for displaying an Excel spreadsheet provided in the embodiments of this application Figure 1 .like Figure 1 As shown, the method in this embodiment includes:
[0071] S101. Obtain the Excel table to be displayed, and determine the source data based on the Excel table;
[0072] In this embodiment, Excel stands for Microsoft Office Excel, a spreadsheet software developed by Microsoft for computers using Windows and Apple Macintosh (MAC) operating systems. Excel spreadsheets can be in .xlsx or .xls format.
[0073] S102. Determine the header data and content data based on the source data; wherein, the header data includes multiple header arrays; each header array includes multiple header names;
[0074] In this embodiment, the header data refers to the beginning of the Excel spreadsheet, used to categorize the nature of the table content data. The header data of the Excel spreadsheet reflects a brief overview of the table content data. In the first example, the Excel spreadsheet is a survey form. The header data includes the first header array containing the name of the respondent, the second header array containing the age, and the third header array containing: family relationship, relationship one, relationship two, and relationship three. The table content data includes content corresponding to the header data. The first table content array contains Zhang San, the second table content array contains 20 years old, and the third table content array contains: a father-son relationship with Zhang Si, a mother-son relationship with Wang Wu, and a husband-wife relationship with Zhang Liu.
[0075] S103. Determine the header style of the header data on the target display page based on the header name;
[0076] In this embodiment, a baseline header array is determined based on the header array that occupies the most rows in the header data. All header arrays are then completed based on the header array to ensure that the number of rows and height of all header arrays are consistent. Then, header names that occupy multiple rows in the same header array are merged and deduplicated so that the height of header names occupying multiple rows remains unchanged after merging, and only one header name occupying one row is included.
[0077] S104. Based on the header style and table content data, render and generate the target display page to display the Excel spreadsheet.
[0078] In this embodiment, the target display page is a web page.
[0079] The method for displaying Excel spreadsheets provided in this application obtains the Excel spreadsheet to be displayed, determines the source data based on the Excel spreadsheet, determines the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determines the header style of the header data on the target display page based on the header names, and renders and generates the target display page based on the header style and table content data to display the Excel spreadsheet. This method automatically determines the header style of the Excel spreadsheet on the target display page by classifying the headers according to the corresponding header data of the Excel spreadsheet, performing completion, merging, and deduplication processing on the header array with the most rows, and rendering and generating the target display page based on the header style and table content data. It eliminates the need for manually pre-setting table styles or hardcoding the headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel spreadsheet, reducing manpower and time costs, reducing the probability of mismatch between headers and table content, and achieving the technical effect of improving processing efficiency and accuracy.
[0080] Figure 2 The flowchart of the method for displaying an Excel spreadsheet provided in the embodiments of this application Figure 2 The method in this embodiment includes:
[0081] S201. Obtain the Excel table to be displayed, and determine the source data based on the Excel table;
[0082] S202. Determine the header data and table content data based on the source data; wherein, the header data includes multiple header arrays; each header array includes multiple header names;
[0083] S203. Determine whether the header names in each header array are the same; if so, generate a first-level header style that occupies one row on the target display page based on the header name, and determine the first-level header style as the header style of the header data on the target display page.
[0084] In this embodiment, in the second example, the Excel spreadsheet is a mobile phone number table. The header data includes four header arrays, and the header name in each header array is "mobile phone number". Based on the header name "mobile phone number", a first-level header style that occupies one row on the target display page is generated, and the first-level header style is determined as the header style of the header data on the target display page.
[0085] S204. If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; where the base header array occupies N rows in the target display page, and N is a positive integer;
[0086] In this embodiment, a baseline header array is determined based on the header array that occupies the most rows in the header data. All header arrays are then completed based on the header array to ensure that the number of rows and height of all header arrays are consistent. Then, header names that occupy multiple rows in the same header array are merged and deduplicated so that the height of header names occupying multiple rows remains unchanged after merging, and only one header name occupying one row is included.
[0087] S205. Based on the header name, perform hierarchical processing on the corresponding header array to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N;
[0088] S206. Based on the header name and base header array corresponding to the L-level header, perform completion processing on the corresponding columns of the L-level header so that the number of rows occupied by the completed header array and the base header array on the target display page are both N rows, and the height occupied by the completed header array and the base header array on the target display page is the same, so that each header array occupies N rows on the target display page, and the height occupied by each header array on the target display page is the same.
[0089] S207. Perform format processing on the header data based on the breadth-first traversal algorithm to ensure that the header data has a uniform format.
[0090] S208. Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row. The height of the row occupied by the merged M identical header names is the same as the height occupied by the M identical header names before merging, so that each header array occupies the same height in the target display page.
[0091] S209. Determine the M header names in a row occupied by the M identical header names after merging, remove M-1 header names so that a row occupied by the M identical header names after merging includes one header name, and determine the header style in the target display page.
[0092] S210. Based on the header style and table content data, render and generate the target display page to display the Excel spreadsheet.
[0093] In the first example above, the Excel spreadsheet is a survey form. The header data includes the first header array "Name", the second header array "Age", and the third header array "Family Relationship, Relationship 1, Relationship 2, Relationship 3". Based on the header names, the number of rows occupied by the corresponding header arrays on the target display page is determined, and the results are shown in Table 1 below. The third header array, which occupies 2 rows, is the base header array. Based on the header names of the last-level headers of each header array, the header arrays are padded to match the number of rows occupied by the base header array, and the results are shown in Table 2 below. When any header name occupies M rows and M is greater than 1, the M identical header names are merged into one row, as shown in Table 3 below. The M header names in the row occupied by the merged M identical header names are determined, and M-1 header names are removed. The row occupied by the merged M identical header names includes one header name. The header style on the target display page is determined, as shown in Table 4 below.
[0094] Table 1
[0095]
[0096] Table 2
[0097]
[0098] Table 3
[0099]
[0100] Table 4
[0101]
[0102] The method for displaying an Excel spreadsheet provided in this application involves obtaining the Excel spreadsheet to be displayed, determining the source data based on the Excel spreadsheet, determining the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determining the header style of the header data on the target display page based on the header names, and rendering and generating the target display page based on the header style and table content data to display the Excel spreadsheet; thereby determining the header array and the header names included in the header array according to the header data corresponding to the Excel spreadsheet, classifying the header array according to the header names, and selecting the header array with the most rows. The baseline header array is determined, and all header arrays are completed, merged, and deduplicated based on it. This ensures that each header array occupies the same height on the target display page, and that the header name in each header array is unique. This determines the header style of the Excel table on the target display page. The target display page is then rendered based on the header style and table content data. This eliminates the need for manually pre-setting table styles or hardcoding headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel table. This reduces manpower and time costs, lowers the probability of mismatch between headers and table content, and achieves the technical effect of improving processing efficiency and accuracy.
[0103] Figure 3 This is a schematic diagram of the structure of an Excel spreadsheet display device provided in an embodiment of this application. The device in this embodiment can be in the form of software and / or hardware. For example... Figure 3 As shown in the embodiment of this application, an Excel spreadsheet display device 300 is provided. The device includes: a processing module 301, a first determining module 302, a second determining module 303, and a rendering module 304.
[0104] Processing module 301 is used to obtain the Excel table to be displayed and determine the source data based on the Excel table;
[0105] The first determining module 302 is used to determine the header data and table content data based on the source data; wherein, the header data includes multiple header arrays; each header array includes multiple header names;
[0106] The second determining module 303 is used to determine the header style of the header data in the target display page based on the header name;
[0107] Rendering module 304 is used to render and generate the target display page based on the header style and table content data to display the Excel spreadsheet.
[0108] In one possible implementation, the second determining module 303 is further configured to:
[0109] Determine if the header names in each header array are the same;
[0110] If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; where the base header array occupies N rows in the target display page, and N is a positive integer;
[0111] The header style of each header array in the header data on the target display page is determined based on the baseline header array; wherein, each header array in the header data occupies the same height on the target display page.
[0112] In one possible implementation, the second determining module 303 is further configured to:
[0113] Based on the baseline header array, each header array is padded to ensure that each header array occupies N rows on the target display page and that each header array occupies the same height on the target display page.
[0114] Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row. The height of the row occupied by the merged M identical header names is the same as the height occupied by the M identical header names before merging, so that each header array occupies the same height on the target display page.
[0115] The table header names in a row containing M identical header names after merging are deduplicated so that each row contains only one header name, and the header style in the target display page is determined.
[0116] In one possible implementation, the second determining module 303 is further configured to:
[0117] The corresponding header array is hierarchically processed based on the header name to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N;
[0118] Based on the header name corresponding to the L-level header and the base header array, the corresponding columns of the L-level header are completed so that the completed header array and the base header array both occupy N rows on the target display page, and the completed header array and the base header array occupy the same height on the target display page.
[0119] In one possible implementation, the second determining module 303 is further configured to:
[0120] Determine the M header names in a single row that contains the M identical header names after merging;
[0121] Remove M-1 header names so that each row containing the M identical header names after merging includes only one header name.
[0122] In one possible implementation, the second determining module 303 is further configured to:
[0123] The header data is formatted using a breadth-first traversal algorithm to ensure a consistent format.
[0124] In one possible implementation, the second determining module 303 is further configured to:
[0125] If the header names in each header array are the same, a first-level header style that occupies one row on the target display page is generated based on the header name, and the first-level header style is determined as the header style of the header data on the target display page.
[0126] The Excel spreadsheet display device provided in this application acquires the Excel spreadsheet to be displayed, determines the source data based on the Excel spreadsheet, determines the header data and table content data based on the source data, wherein the header data includes multiple header arrays, each header array includes multiple header names, determines the header style of the header data on the target display page based on the header names, and renders and generates the target display page based on the header style and table content data to display the Excel spreadsheet; thereby determining the header array and the header names included in the header array according to the header data corresponding to the Excel spreadsheet, classifying the header array according to the header names, and placing the header array with the most rows as the first to be displayed. The baseline header array is determined, and all header arrays are completed, merged, and deduplicated based on it. This ensures that each header array occupies the same height on the target display page, and that the header name in each header array is unique. This determines the header style of the Excel table on the target display page. The target display page is then rendered based on the header style and table content data. This eliminates the need for manually pre-setting table styles or hardcoding headers on the target display page, and also eliminates the need to set corresponding fields on the front-end and back-end to display the Excel table. This reduces manpower and time costs, lowers the probability of mismatch between headers and table content, and achieves the technical effect of improving processing efficiency and accuracy.
[0127] Figure 4 This is a hardware structure diagram of the device displaying the Excel spreadsheet provided in an embodiment of this application. Figure 4 As shown, the display device 400 for the Excel spreadsheet includes:
[0128] Processor 401 and memory 402;
[0129] The memory stores the instructions that the computer executes;
[0130] The processor executes the computer execution instructions stored in memory 402, causing the Excel spreadsheet display device to perform the Excel spreadsheet display method described above.
[0131] It should be understood that the processor 401 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The memory 402 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, or a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0132] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a method for displaying an Excel spreadsheet.
[0133] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0134] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for displaying an Excel spreadsheet, characterized in that, include: Obtain the Excel spreadsheet to be displayed, and determine the source data based on the Excel spreadsheet; Based on the source data, the table header data and table content data are determined; wherein, the table header data includes multiple table header arrays; each table header array includes multiple table header names; The header style of the header data in the target display page is determined based on the header name; Based on the header style and the table content data, the target display page is rendered and generated to display the Excel spreadsheet; Determining the header style of the header data on the target display page based on the header name includes: Determine whether the header names in each of the header arrays are the same; If so, a first-level header style that occupies one row on the target display page is generated based on the header name, and the first-level header style is determined as the header style of the header data on the target display page; If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; wherein, the base header array occupies N rows in the target display page, where N is a positive integer; Based on the header name, the corresponding header array is hierarchically processed to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N; Based on the header name corresponding to the L-level header and the baseline header array, the corresponding columns of the L-level header are completed so that the completed header array and the baseline header array both occupy N rows in the target display page, and the completed header array and the baseline header array occupy the same height in the target display page. Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row, and the height of the row occupied by the merged M identical header names is the same as the height of the M identical header names before merging. The header names in a row occupied by the M identical header names after merging are deduplicated, removing M-1 header names so that a row occupied by the M identical header names after merging includes only one header name, thus determining the header style in the target display page; wherein, each header array in the header data occupies the same height in the target display page.
2. The method according to claim 1, characterized in that, Before determining the number of rows occupied by the header name in each of the header arrays, the process includes: The header data is formatted using a breadth-first traversal algorithm to ensure that the header data has a uniform format.
3. An Excel spreadsheet display device, characterized in that, include: The processing module is used to obtain the Excel spreadsheet to be displayed and determine the source data based on the Excel spreadsheet; The first determining module is used to determine the header data and table content data based on the source data; wherein, the header data includes multiple header arrays; each header array includes multiple header names; The second determining module is used to determine the header style of the header data in the target display page based on the header name; The rendering module is used to render and generate the target display page based on the header style and the table content data to display the Excel spreadsheet; The second determining module is specifically used for: Determine whether the header names in each of the header arrays are the same; If so, a first-level header style that occupies one row on the target display page is generated based on the header name, and the first-level header style is determined as the header style of the header data on the target display page; If not, determine the number of rows occupied by the corresponding header array in the target display page based on the header name, and determine the header array with the most rows as the base header array; wherein, the base header array occupies N rows in the target display page, where N is a positive integer; Based on the header name, the corresponding header array is hierarchically processed to obtain a header array divided into L levels; where L is a positive integer and L is less than or equal to N; Based on the header name corresponding to the L-level header and the baseline header array, the corresponding columns of the L-level header are completed so that the completed header array and the baseline header array both occupy N rows in the target display page, and the completed header array and the baseline header array occupy the same height in the target display page. Determine the number of rows occupied by each header name in each header array. When the number of rows occupied by any header name is M and M is greater than 1, merge the M identical header names into one row, and the height of the row occupied by the merged M identical header names is the same as the height of the M identical header names before merging. The header names in a row occupied by the M identical header names after merging are deduplicated, removing M-1 header names so that a row occupied by the M identical header names after merging includes only one header name, thus determining the header style in the target display page; wherein, each header array in the header data occupies the same height in the target display page.
4. An Excel spreadsheet display device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory, causing the Excel spreadsheet display device to perform the Excel spreadsheet display method as described in claim 1 or 2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for displaying an Excel spreadsheet as described in claim 1 or 2.
Citation Information
Patent Citations
Table information display method and device, equipment and storage medium
CN111241796A
Table construction method and device
CN115719055A