CN110222291A - A kind of table merging method - Google Patents
A kind of table merging method Download PDFInfo
- Publication number
- CN110222291A CN110222291A CN201910340680.4A CN201910340680A CN110222291A CN 110222291 A CN110222291 A CN 110222291A CN 201910340680 A CN201910340680 A CN 201910340680A CN 110222291 A CN110222291 A CN 110222291A
- Authority
- CN
- China
- Prior art keywords
- data
- cell
- content
- merge
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a kind of table merging methods, and step 1: customization universal data interface, initial data carry out biography ginseng by HTML encapsulation, while defining demand and excluding combined row set, column set, specific data;Step 2: the cell in table is traversed one by one, obtains the data content of current cell;Step 3: first determining whether current cell data belong to the content that needs exclude defined in step 1, and operation is ignored if the content for belonging to exclusion, then obtains next cell data;Step 4: if in adjacent four cells comprising it is consistent with current cell data, and current data allow merge when, then to containing identical data cell carry out status set, being identified as can merge;Step 5: after carrying out the above judgement and operation, then reading next cell, until completing all cell data read operations;Step 6: the data for completing operation are exported finally by interface.
Description
Technical field
The invention belongs to technical field of information processing, and in particular to a kind of table merging method.
Background technique
With making rapid progress for network technology, data visualization using more and more extensive, especially traditional chart is shown
Mode in webpage using more and more, it is desirable that it is also higher and higher.One, which is always existed, in table display application allows technology
Personnel very headache the technical issues of be difficult to solve, that is, the cell span problem of identical data.As depicted in figs. 1 and 2.
For above problem, technical staff solves the problems, such as often by the mode for solidifying table.But with data
It widely applies, solidification table style cannot solve practical problems, and cannot be general, and adjustment system is both needed to whenever changes in demand
Unite or develop new function.The method shown therefore, it is necessary to design a set of merging table that can be general, for adjacent cells and
Automatic union operation under data unanimous circumstances.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide a kind of table merging methods.
The present invention is achieved by the following technical solutions:
A kind of table merging method, comprising the following steps:
Step 1: customization universal data interface, initial data carry out biography ginseng by HTML encapsulation, while defining demand exclusion
Combined row set, column set, specific data;
Step 2: the cell in table is traversed one by one, obtains the data content of current cell;
Step 3: first determining whether current cell data belong to the content that needs exclude defined in step 1,
Ignore operation if the content for belonging to exclusion, then obtains next cell data;
Step 4: if include consistent with current cell data in adjacent four cells, and current data allows
When merging, then status set is carried out to the cell containing identical data, being identified as can merge;
Step 5: after carrying out the above judgement and operation, then reading next cell, until completing all cell data
Read operation;
Step 6: the data for completing operation are exported finally by interface.
In the above-mentioned technical solutions, further, step 6 output data is html format, is provided just for third party system
Benefit.
The advantages and benefits of the present invention are:
1, a kind of merging identical data and the adjacent algorithm of cell are provided, development language is not limited to;
2, customized and automatic calculating combines, and achievees the purpose that flexible customization;
3, input interface is defined, exports result after operation in time;
4, using the html format output data being widely used, convenience is provided for third party system;
5, using scripting language, developer's personalization modification is supported.
Detailed description of the invention
Fig. 1 is the cell span example in background technique.
Fig. 2 is the cell span example in background technique.
Fig. 3 is the flow chart of the table merging method of the embodiment of the present invention.
It for those of ordinary skill in the art, without creative efforts, can be according to above attached
Figure obtains other relevant drawings.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, combined with specific embodiments below furtherly
Bright technical solution of the present invention.
A kind of table merging method, referring to attached drawing 3, comprising the following steps:
Step 1: customization universal data interface, initial data carry out biography ginseng by HTML encapsulation, while defining demand exclusion
Combined row set, column set, specific data;
Step 2: the cell in table is traversed one by one, obtains the data content of current cell;
Step 3: first determining whether current cell data belong to the content that needs exclude defined in step 1,
Ignore operation if the content for belonging to exclusion, then obtains next cell data;
Step 4: if include consistent with current cell data in adjacent four cells (upper and lower, left and right), and
When current data allows to merge, then status set is carried out to the cell containing identical data, being identified as can merge;
Step 5: after carrying out the above judgement and operation, then reading next cell, until completing all cell data
Read operation;
Step 6: the data for completing operation are exported finally by interface, output data is html format, is for third party
System provides convenience.
Here is specific implementation algorithm:
1, prepare parameter
A) table volume data list
B) Sheet pages of title
C) the first ranks of gauge outfit concrete number group
D) gauge outfit the first row Merge Cells parameter array
E) gauge outfit the first row data filling index
F) gauge outfit the second ranks name array (if not being set as null)
G) gauge outfit the second row Merge Cells parameter array (if not being set as null)
H) gauge outfit the second row data filling index (if not being set as null)
I) gauge outfit the second row data filling index (if not being set as null)
J) table volume data field name array
K) table volume data indexes
L) number (the index total quantitys -1 of column) of dynamic Merge Cells column
2, a table is created
HSSFWorkbookworkbook=newHSSFWorkbook ();
HSSFSheet sheet=workbook.createSheet (sheetName);
3, title pattern
HSSFFont font=workbook.createFont ();
Font.setFontName (" Song typeface ");
font.setFontHeightInPoints((short)12);// font size
HSSFCellStyle style=workbook.createCellStyle ();
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);// lower frame
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);// left frame
style.setBorderTop(HSSFCellStyle.BORDER_THIN);// upper side frame
style.setBorderRight(HSSFCellStyle.BORDER_THIN);// left frame
style.setFont(font);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// center ofthe
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// placed in the middle up and down
style.setLocked(true);
4, table volume data pattern
5, the first row gauge outfit column name is shown
6, dynamic merges the first row gauge outfit cell
7, the gauge outfit of the parameter of Merge Cells and initialization with frame is arranged, and (doing so can be to avoid because of combining unit
The frame for the cell having after lattice, which is displayed without, to be come)
8, dynamic Merge Cells
Illustrative description has been done to the present invention above, it should explanation, the case where not departing from core of the invention
Under, any simple deformation, modification or other skilled in the art can not spend the equivalent replacement of creative work equal
Fall into protection scope of the present invention.
Claims (2)
1. a kind of table merging method, it is characterised in that: the following steps are included:
Step 1: customization universal data interface, initial data carry out biography ginseng by HTML encapsulation, while defining demand and excluding to merge
Row set, column set, specific data;
Step 2: the cell in table is traversed one by one, obtains the data content of current cell;
Step 3: first determining whether current cell data belong to the content that needs exclude defined in step 1, if
The content for belonging to exclusion then ignores operation.Next cell data are obtained again;
Step 4: if include consistent with current cell data in adjacent four cells, and current data allows to merge
When, then status set is carried out to the cell containing identical data, being identified as can merge;
Step 5: after carrying out the above judgement and operation, then reading next cell, until completing all cell reading data
Operation;
Step 6: the data for completing operation are exported finally by interface.
2. table merging method according to claim 1, it is characterised in that: step 6 output data is html format, is
Third party system provides convenience.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910340680.4A CN110222291A (en) | 2019-04-25 | 2019-04-25 | A kind of table merging method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910340680.4A CN110222291A (en) | 2019-04-25 | 2019-04-25 | A kind of table merging method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110222291A true CN110222291A (en) | 2019-09-10 |
Family
ID=67820023
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910340680.4A Pending CN110222291A (en) | 2019-04-25 | 2019-04-25 | A kind of table merging method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110222291A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111444689A (en) * | 2020-06-17 | 2020-07-24 | 广州市玄武无线科技股份有限公司 | Data-based table cell merging method and system |
CN116205204A (en) * | 2023-03-01 | 2023-06-02 | 北京中宏立达科技发展有限公司 | Dynamic form merging method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101388028A (en) * | 2008-09-19 | 2009-03-18 | 金蝶软件(中国)有限公司 | Method and apparatus for combining cells |
CN108572946A (en) * | 2018-04-26 | 2018-09-25 | 珠海横琴盛达兆业科技投资有限公司 | A method of realizing that the data dynamic of bootstrap table tables merges |
CN109446506A (en) * | 2018-11-12 | 2019-03-08 | 江苏中威科技软件系统有限公司 | A kind of method and apparatus that electronic spreadsheet table reproduces automatically |
-
2019
- 2019-04-25 CN CN201910340680.4A patent/CN110222291A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101388028A (en) * | 2008-09-19 | 2009-03-18 | 金蝶软件(中国)有限公司 | Method and apparatus for combining cells |
CN108572946A (en) * | 2018-04-26 | 2018-09-25 | 珠海横琴盛达兆业科技投资有限公司 | A method of realizing that the data dynamic of bootstrap table tables merges |
CN109446506A (en) * | 2018-11-12 | 2019-03-08 | 江苏中威科技软件系统有限公司 | A kind of method and apparatus that electronic spreadsheet table reproduces automatically |
Non-Patent Citations (1)
Title |
---|
DJ0721: "poi导出Excel报表多表头双层表头、合并单元格", 《CSDN》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111444689A (en) * | 2020-06-17 | 2020-07-24 | 广州市玄武无线科技股份有限公司 | Data-based table cell merging method and system |
CN111444689B (en) * | 2020-06-17 | 2020-10-09 | 广州市玄武无线科技股份有限公司 | Data-based table cell merging method and system |
CN116205204A (en) * | 2023-03-01 | 2023-06-02 | 北京中宏立达科技发展有限公司 | Dynamic form merging method and system |
CN116205204B (en) * | 2023-03-01 | 2023-08-04 | 北京中宏立达科技发展有限公司 | Dynamic form merging method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106204692B (en) | A kind of ocean section drawing drawing method based on GIS platform | |
CN104036060B (en) | A kind of online checking method of engineering drawing and system | |
CN103324731A (en) | Method and device for converting spreadsheet file into web format file | |
CN103677789B (en) | Table data based on GRID components shows method and system | |
CN103955345B (en) | A kind of data-printing method and system | |
CN104503955B (en) | A method of generating personalization excel list evidences | |
CN103279455B (en) | The pattern treatment process of electrical form and device | |
CN106469140A (en) | A kind of report generating system and its method | |
CN101751379B (en) | Method and equipment for manufacturing electronic newspaper document | |
CN110222291A (en) | A kind of table merging method | |
CN102830947A (en) | Report printing control implemented based on report printing template format | |
CN115146584A (en) | Full-structured Web version electronic medical record editor system | |
CN106126779B (en) | Applied to the configuration multiplexing method in SVG picture configuration | |
CN105608119A (en) | Rapid thematic map drawing technology | |
CN102157003A (en) | Automatic configuration method for annotation label of map under digital environment | |
CN105631080A (en) | Automatic generation device and method of vector power grid wiring diagram | |
CN104298705A (en) | Converting method of relational data and unstructured data | |
CN112199929A (en) | Form processing method and device, storage medium and electronic equipment | |
CN103970890B (en) | Real-time webpage data generation method and device | |
CN106484388A (en) | The implementation method of user interface and device | |
CN111694563B (en) | Visual design system and method for user interface mode | |
CN103294819B (en) | The method that Pagination Display is carried out to web page contents using HTML5 technologies | |
CN101739498A (en) | Method for accurately designing and building ArcGIS symbol library | |
CN106354496A (en) | Quick edit system and edit method applied to converge data news in media industry | |
CN106273470B (en) | Three-dimensional printing device and its print data storage method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |