Commit Graph

112 Commits

Author SHA1 Message Date
xuri e9ae9b45b2
change go module import path to github.com/xuri/excelize 2021-07-28 00:38:09 +08:00
xuri 90d200a10b
Make the functions `SetSheetRow`, `New Style` and `SetCellStyle` concurrency safety 2021-07-07 00:57:43 +08:00
xuri 544ef18a8c
- Support concurrency iterate rows and columns
- Rename exported field `File.XLSX` to `File.Pkg`
- Exported error message
2021-07-05 00:03:56 +08:00
xuri 2cfcf9eb5f encode the escaped string literal which not permitted in an XML 1.0 document 2021-06-16 15:03:50 +00:00
xuri be12cc27f1
This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message 2021-05-10 00:09:24 +08:00
xuri f8f699a172
Go 1.15 and later required, #65 fn: IMABS, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN and IMLOG10 2021-04-04 15:29:43 +08:00
xuri 2af96c0714
#65 fn: N, PERCENTILE.INC and T
typo fixed
2021-03-30 23:02:22 +08:00
James Allen a12dfd3ce6
Add support for setting hyperlink display & tooltip (closes #790) (#794) 2021-03-03 20:30:31 +08:00
xuri 5a0d885315
handle default underline type on get rich text; #65 fn: CODE, COLUMN, FIND, FINDB 2021-02-24 00:37:44 +08:00
xuri d84050921e
check empty rich text run properties; new formula fn: LEFT, LEFTB, RIGHT, RIGHTB 2021-02-23 00:05:19 +08:00
tonnyzhang bbb8ebfa8c
add GetCellRichText method and test (#789) 2021-02-22 20:04:13 +08:00
xuri 2833395347
This closes #787, avoid duplicate rich text string items, new formula fn: BIN2DEC, BIN2HEX, BIN2OCT, HEX2BIN, HEX2DEC, HEX2OCT, OCT2BIN, OCT2DEC, OCT2HEX 2021-02-21 00:21:45 +08:00
xuri 9154d500cf ref: #756, set cell as blank when SetCellValue with nil #756, new formula fn: BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR 2021-02-19 00:20:27 +08:00
xuri a26675517e
This closes #756, not set the empty string for the cell when SetCellValue with nil 2021-01-08 23:57:13 +08:00
Zhang Zhipeng ad79505173
new formula func CLEAN and TRIM, change import path to v2 (#747) 2020-12-14 09:56:42 +08:00
Artem Kustikov 61057c58d3
Number format read fix (#741)
* fix UT-generated file names to be ignored
* fix cell value load with invalid number format ID
* fix PR issues
2020-12-12 16:17:00 +08:00
xuri 13e0ed2a69
Fixed #735, refresh active tab after delete sheet 2020-11-23 00:01:06 +08:00
xuri 2514bb16c6 Fix #724, standardize variable naming and update unit tests 2020-11-11 01:03:56 +08:00
xuri 4834a058aa
This closes #714 and closes #715, fix wrong worksheet index returned by NewSheet in some case, fix panic on formatted value with no built-in number format ID 2020-10-19 23:55:54 +08:00
Artem Kustikov f2b8798a34
extend cell value load to support custom datetime format (#703)
* extend cell value load to support custom datetime format

* cleanup incorrect imports

* fix numeric values conversion as done in legacy Excel

* fix tests coverage

* revert temporary package name fix

* remove personal info from test XLSX files

* remove unused dependencies

* update format conversion in parseTime

* new UT to increase code coverage

* Resolve code review issue for PR #703

* Rename broken file name generated by unit test

Co-authored-by: xuri <xuri.me@gmail.com>
2020-10-04 21:07:39 +08:00
xuri 88de2f8d51
Default row height compatibility with Apache OpenOffice and Kingsoft WPS, unit test update and typo fixed 2020-08-22 18:58:43 +08:00
xuri c3e92a51d7 Compatible with Go 1.15, fix unit test failed on Windows and fixed #689 potential race condition 2020-08-15 09:19:35 +00:00
xuri c922c32fb7
support parse and generate XML element namespace dynamic, fix #651 2020-07-18 15:15:16 +08:00
xuri f7bd0729c6
Resolve #32, fix missing leading/leading spaces when working with SST 2020-07-01 22:41:29 +08:00
xuri 15fd56853f
Update docs and typo fixed 2020-06-22 00:14:56 +08:00
xuri 5221729bc3
make columns iterator read cell streamingly and add max column limit on ColumnNumberToName 2020-06-22 00:05:19 +08:00
heiy eb150c0c22 escape html tag 2020-06-08 18:23:38 +08:00
xuri 2ae631376b
add limits for total columns, row and filename length 2020-05-29 00:26:40 +08:00
xuri c168233e70
speedup get cell value from shared string table 2020-05-27 00:02:29 +08:00
xuri 5c99300ee4
Fix #622, storage string to SST (shared string table) 2020-05-26 02:09:39 +08:00
xuri ec14de32f0
Merge branch 'master' into fix/cell_lock 2020-05-22 16:53:46 +08:00
xuri 882abb8098
- formula engine: reduce cyclomatic complexity
- styles: allow empty and default cell formats, #628
2020-05-10 16:56:08 +08:00
xuri 1fe660df64
- Resolve #485 use sheet index instead of ID
-  added 3 internal function: getSheetID, getActiveSheetID, getSheetNameByID
2020-04-23 02:01:14 +08:00
xuri e36650f4ff
Resolve #598, filter support for AddPivotTable 2020-04-09 01:00:14 +08:00
xuri 66d0272f6a
Resolve #172, init rich text support 2020-04-06 00:23:27 +08:00
xuri 09485b3f9f
Improve code coverage unit tests 2019-12-29 16:02:31 +08:00
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 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 4e4a5b9b3e
Improve compatibility, fix workbook's rels ID calc error 2019-12-23 00:07:40 +08:00
xuri da0d2ffbb6 Fix #533, add support overlapped mergecells 2019-12-14 19:57:37 +08:00
马彦军 aa7eadbffe fix go lock 2019-11-14 14:30:25 +08:00
xuri 2e791fa433 Optimize code of Getting/Setting Page Margins 2019-10-17 00:02:39 +08:00
heiy 810139f5fc solve ending space missing 2019-10-10 20:04:33 +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 8922f65978
Combine functions:
workBookRelsWriter, drawingRelsWriter into relsWriter;
drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader;
addDrawingRelationships, addSheetRelationships into addRels
2019-09-16 01:17:35 +08:00
mqy 64809db2c9 add missing error check in SetSheetRow() 2019-08-19 15:53:56 +08:00
Olivier Mengué ac395a60ed SetCellValue: use fmt.Sprint(v) instead of fmt.Sprintf("%v", v)
Because that does the same thing, but without having to parse a format
string.

Signed-off-by: Olivier Mengué <dolmen@cpan.org>
2019-08-13 15:57:35 +02:00
xuri 9c70d0ac86
Documentation updated, Go 1.10+ required 2019-08-11 00:36:14 +08:00
xuri 821632cf89
Fix #424, refactor merged cells adjuster 2019-06-12 08:10:33 +08:00
xuri b45c4b094c Add a check for maximum limit hyperlinks in a worksheet
typo fixed
2019-04-21 00:20:19 +08:00