Commit Graph

599 Commits

Author SHA1 Message Date
Cameron Howey 5c87effc7e Stream to Excel table (#530)
* Support all datatypes for StreamWriter

* Support setting styles with StreamWriter

**NOTE:** This is a breaking change. Values are now explicitly
passed as a []interface{} for simplicity. We also let styles to be
set at the same time.

* Create function to write stream into a table

* Write rows directly to buffer

Avoiding the xml.Encoder makes the streamer faster and use less
memory.

Using the included benchmark, the results went from:

> BenchmarkStreamWriter-4   514  2576155 ns/op  454918 B/op  6592 allocs/op

down to:

> BenchmarkStreamWriter-4  1614   777480 ns/op  147608 B/op  5570 allocs/op

* Use AddTable instead of SetTable

This requires reading the cells after they have been written,
which requires additional structure for the temp file.

As a bonus, we now efficiently allocate only one buffer when
reading the file back into memory, using the same approach
as ioutil.ReadFile.

* Use an exported Cell type to handle inline styles for StreamWriter
2019-12-29 12:45:10 +08:00
xuri 8b960ee1e6
Fix #547 and #546, add default overlay element for the chart 2019-12-28 15:05:44 +08:00
xuri 5f3a4bc39f
Fix #538, added setting a major unit and tick label skip support for the chart 2019-12-25 00:00:50 +08:00
xuri 1666d04559
optimization: checking error in unit tests 2019-12-24 01:09:28 +08:00
xuri 4e4a5b9b3e
Improve compatibility, fix workbook's rels ID calc error 2019-12-23 00:07:40 +08:00
xuri ae2865d923
Improve code coverage unit tests 2019-12-22 00:02:09 +08:00
match-meng 7358dca436 Update comments for the xmlNewDecoder (#542) 2019-12-20 22:22:56 +08:00
xuri 4249dad8ea
Resolve #539 Merge branch 'v2'
# Conflicts:
#	rows.go
#	sheet.go
2019-12-20 01:00:15 +08:00
Alex Geer b1b3c0d151 Fix #539 Fixed error opening excel file created in encoding d… (#540)
* Fixed issue #539 Fixed error opening excel file created in encoding different from UTF-8, added logging of possible errors when decoding XML if the function does not provide exit with an error

* Added test for CharsetReader

* Fixed #discussion_r359397878

Discussion: https://github.com/360EntSecGroup-Skylar/excelize/pull/540#discussion_r359397878

* Fixed go fmt

* go mod tidy and removed unused imports

* The code has been refactored
2019-12-20 00:30:48 +08:00
xuri a526e90404
Fix #426, handle empty workbook view 2019-12-16 08:32:04 +08:00
xuri 3763228ea7
Fix #533 Merge pull request #536 from match-meng/mergecell
Fix #533, add support overlapped mergecells
2019-12-15 10:09:34 +08:00
xuri da0d2ffbb6 Fix #533, add support overlapped mergecells 2019-12-14 19:57:37 +08:00
Xudong Zhang 4c433c57e6 Resolve #527, unmerge an area (#528) 2019-12-13 21:43:59 +08:00
xuri 5d8365ca17
Fix #529, handle empty inline rich text 2019-12-11 00:02:33 +08:00
xuri 08d1a86c3a
Fix #523, add stream writer for generate new worksheet with huge amounts of data 2019-12-10 00:16:17 +08:00
xuri 842b942c71
Compatible with up to 64 namespaces of Kingsoft WPS 2019-12-02 22:39:32 +08:00
xuri 402ad2f62b
Update XML namespace 2019-11-30 00:06:36 +08:00
xuri 8d6e431dcd
Resolve #521, fix missing elements when parsing 2019-11-28 21:53:50 +08:00
xuri 7965e1231b
Resolve #146, make the GetRow function read data as streaming. Ref: #382, #515 2019-11-23 04:13:59 +08:00
马彦军 aa7eadbffe fix go lock 2019-11-14 14:30:25 +08:00
xuri c8c8397751
Fix #494 Merge pull request #514 from mlh758/fix-494-write-allocations
Reduce allocations when writing
2019-11-10 16:51:15 +08:00
Harris bf9a835549
Reduce allocations when writing
Fix #494

If a row is full, don't bother allocating a new one, just return it.

Use the last populated row as a hint for the size of new rows.

Simplify checkSheet to remove row map
2019-11-05 08:18:11 -06:00
xuri 6abf8bf972
Resolve #501, support set minor grid lines for the chart 2019-10-27 14:16:02 +08:00
xuri 5e418ebd66
Resolve #507, add the new function `DeleteDefinedName` 2019-10-26 20:55:24 +08:00
xuri 87390cdd99
Resolve #511, allow empty columns in the pivot table 2019-10-24 23:18:02 +08:00
Michael 9fe267ffcf Pre-allocate some memory when reading files (#510) 2019-10-24 22:14:33 +08:00
xuri e7581ebf3e
Fix corrupted Excel file issue #413 2019-10-23 10:08:29 +08:00
xuri 7716968abc
Fix #505, support set line width of the line chart 2019-10-21 00:04:18 +08:00
ducquangkstn 866fda2300 fix #503 rows next issue 2019-10-18 14:57:35 +08:00
xuri 2e791fa433 Optimize code of Getting/Setting Page Margins 2019-10-17 00:02:39 +08:00
streboryaj 2d21b5b50f Added accessors for Getting/Setting Page Margins (#497)
* Added accessors for Getting/Setting Page Margins

* Added test cases
2019-10-15 22:26:08 +08:00
xuri af100372a0
Merge pull request #498 from heiy/master
solve ending space missing
2019-10-10 22:40:37 +08:00
heiy 810139f5fc solve ending space missing 2019-10-10 20:04:33 +08:00
xuri a00ba75f0f
Fix #493 Merge pull request #495 from jaby/493-ShowZeros
Add missing ShowZeros SheetViewOption implementation
2019-09-30 21:05:31 +08:00
jaby babfeb6b57 Add missing ShowZeros SheetViewOption implementation 2019-09-30 14:39:30 +02:00
xuri eb520ae277
Improve compatibility for charts 2019-09-26 22:28:14 +08:00
xuri 475fbf3856
Create SECURITY.md 2019-09-25 11:12:16 +08:00
xuri a34d3b8c86
Compatibility improvement 2019-09-24 21:53:19 +08:00
xuri 75d66a03f3
Fix #482, font strike style support 2019-09-23 21:50:03 +08:00
Christian Fiedler 3280e1b686 Allow access to more formula attributes in SetCellFormula (#484)
* Allow access to more formula attributes in SetCellFormula

Make SetCellFormula variadic to not break API.
The new arguments are option arguments in which the type of
the formula and the ref attribute may be set.
These need to be set for an array formula to work.

* Add TestWriteArrayFormula to test optional parameters of SetCellFormula

TestWriteArrayFormula writes a document to the test directory that
contains array formulas that are used to calculate standard deviations.
The file also contains values calculated by the Go testcase, so the
results can be verified. It should be tested, if the array formula
works (i.e. shows a number, not an error) and that the values calculated
by the formula and those calculated by Go are the same.
2019-09-22 20:52:01 +08:00
xuri 3c636da460
Resolve #40, init pivot table support 2019-09-20 00:20:30 +08:00
xuri eef232f09e
Fix #483, adjust the order of fields in the structure 2019-09-18 00:47:31 +08:00
xuri 8922f65978
Combine functions:
workBookRelsWriter, drawingRelsWriter into relsWriter;
drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader;
addDrawingRelationships, addSheetRelationships into addRels
2019-09-16 01:17:35 +08:00
xuri a3ee098ab6
Fix #466, #480 Merge pull request #481 from bvwells/modules
Fix dependency on github.com/360EntSecGroup-Skylar/excelize v1
2019-09-14 22:08:24 +08:00
Ben Wells 3c327413d9 Fix dependency on github.com/360EntSecGroup-Skylar/excelize v1 2019-09-13 11:40:16 +01:00
xuri acbabcf8fc
Add pivot table cache definition struct 2019-09-08 21:57:55 +08:00
xuri b30c642e2b Prepare pivot table support, add pivot table definition struct 2019-09-06 00:01:20 +08:00
xuri 0acb3ef968
Testing files updated 2019-09-02 21:52:55 +08:00
Vsevolod Balashov 1fc4bc52fb Fix #386 regression test added (#440)
* #386 regression test added

* closes #386 string to bigint on GOARCH=386
2019-09-01 12:30:14 +08:00
xuri 333c5881c0
Merge pull request #479 from mtmcfarl/patch-1
Updating Readme
2019-09-01 12:23:19 +08:00