Commit Graph

167 Commits

Author SHA1 Message Date
xuri 9e64df6a96
Update create style example, using a pointer of the structure instead of JSON 2022-01-05 00:13:29 +08:00
xuri 89b85934f6
This closes #1096, memory usage optimization and another 4 changes
- Unzip shared string table to system temporary file when large inner XML, reduce memory usage about 70%
- Remove unnecessary exported variable `XMLHeader`, we can using `encoding/xml` package's `xml.Header` instead of it
- Using constant instead of inline text for default XML path
- Rename exported option field `WorksheetUnzipMemLimit` to `UnzipXMLSizeLimit`
- Unit test and documentation updated
2021-12-27 23:49:28 +08:00
xuri 577a07f08c
Simplify code and update unit test
Improve unit test coverage for the functions: `NewStyle`, `SetActiveSheet`, `SearchSheet` and `deleteAndAdjustDefinedNames`
Simplify code and add comments for the function: `deleteAndAdjustDefinedNames`
2021-12-03 00:19:11 +08:00
Dokiy 45a1f08a2a Fix call getNumFmtID with builtInNumFmt return -1 2021-12-01 19:11:51 +08:00
xuri 49c9ea40d7
ref #65: new formula function YIELD 2021-11-29 01:21:03 +08:00
xuri 9b0aa7ac30
This closes #1060, fix build-in time number format parse error 2021-11-20 11:31:17 +08:00
xuri bc3c7d51a2
ref #65: new formula function PRICE
- fix COUPPCD result accuracy issue
- update close spreadsheet example in documentation and README
2021-11-17 00:25:36 +08:00
xuri 2d8b5b1885
This closes #1027 and closes #1028
* Fix build-in scientific number format failed
* An error will be returned if given an invalid custom number format when creating a new style
2021-09-28 22:02:31 +08:00
xuri 684603befa
This closes #993, closes #1014
- Fix formula percentages calculated incorrectly
- Make UpdateLinkedValue skip macro sheet
- Fix conditional format bottom N not working
2021-09-06 00:01:42 +08:00
xuri a2d449708c
- This fix panic and incorrect cell read on some case
- Make unit test on Go 1.7
- API documentation updated
2021-08-22 13:36:56 +08:00
xuri a55f354eb3
This closes #989, closes #990
New API: `SetRowStyle` support for set style for the rows
Update documentation for the `GetRows`, `SetCellStyle` and `SetColStyle`
2021-08-17 00:01:44 +08:00
xuri 7dbf88f221
This closes #971, closes #972 and closes #974
- Escape XML character in the drop list
- Fix incorrect character count limit in the drop list
- Fix Excel time parse issue in some case
- Fix custom number format month parse issue in some case
- Fix corrupted file generated caused by concurrency adding pictures
2021-07-29 00:03:57 +08:00
xuri 1ec0207fb5
Fix code security issue 2021-07-20 23:04:50 +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
ice c8c62c2d2a
* This closes #841, fix incorrect build number format in PR #839 2021-05-15 23:42:52 +08:00
ice 37342f6d81
"15" is the correct 24 hours time format in go (#839)
* "15" is the correct 24 hours time format in go
* fix number format convert issue and remove the `dateTimeFormatsCache`
2021-05-14 13:01:08 +08:00
xuri 7e429c5b46
Fixe issue generated file corrupted caused by incorrect default XML namespace attributes 2021-04-30 00:14:42 +08:00
xuri f5a20fa03f
Fixed #823, 12/24 hours time format parsing error 2021-04-20 16:01:17 +00: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
xuri e1abdb0e5a
This closes #809, and add new fn: HARMEAN 2021-03-25 00:05:02 +08:00
xuri 36b7990d6b
lint issue fixed and new formula function: ATAN, AVERAGE, AVERAGEA, CONCAT, CONCATENATE, COUNT, COUNTBLANK, MAX 2021-02-15 00:09:35 +08:00
xuri 1f329e8f96
This closes #774, closes #775 and closes #776
- correct adjust calculation chain in duplicate rows
- correct adjust defined name in the workbook when delete worksheet
- use absolute reference in the auto filters defined name to make it compatible with OpenOffice
- API `CoordinatesToCellName` have a new optional param to specify if using an absolute reference format
- Fix cyclomatic complexity issue of internal function `newFills` and `parseToken`
2021-02-02 22:23:16 +08:00
Eagle Xiang 219add2f0e
value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause … (#770)
* value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause ineffective omitempty tags

* remove useless omitempty tag on xlsxPatternFill.FgColor and xlsxPatternFill.BgColor
2021-01-28 21:13:23 +08:00
xuri 2514bb16c6 Fix #724, standardize variable naming and update unit tests 2020-11-11 01:03:56 +08:00
xuri 9d470bb38f
Update conversion between integer types and unit tests 2020-10-23 00:01:52 +08:00
xuri d1926675f8
- Resolve #627, improve multi-series line chart compatibility with KingSoft WPS
- Avoid to create duplicate style
- Update unit test for the auto filter
- Init code scanning alerts
2020-10-11 00:15:04 +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 324f87bcae
add checking and limits for the worksheet 2020-09-18 22:20:58 +08:00
WXDYGR 1c2e7c5c68
Update styles.go
修复获取百分比值时,GetCellValue返回值不准确的问题
2020-08-05 20:33:12 +08:00
xuri c922c32fb7
support parse and generate XML element namespace dynamic, fix #651 2020-07-18 15:15:16 +08:00
xuri 15fd56853f
Update docs and typo fixed 2020-06-22 00:14:56 +08:00
xuri 1aeb818235
avoid creating duplicate number format 2020-05-25 00:22:58 +08:00
xuri a546427fd9
Resolve #643, avoid creating duplicate style 2020-05-24 20:20:22 +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
echarlus a2e1da8d9d
Fix for issue #608 (#609) 2020-04-09 00:50:20 +08:00
xuri 66d0272f6a
Resolve #172, init rich text support 2020-04-06 00:23:27 +08:00
xuri 3f89c6e979
remove ineffectual variable assignments and simplify code 2020-03-29 18:44:24 +08:00
xuri 6afc468a02
Resolve #451, support create chart sheet 2020-03-28 23:47:26 +08:00
xuri cea3d806ec
Resolve #200, ignore empty conditional format style 2020-03-16 00:13:01 +08:00
xuri 9e2318cefa
Resolve #470, export Style structs to allow create the style for cells by given JSON or structure 2020-03-10 00:04:23 +08:00
xuri 1e3c85024d
Resolve #571, init remove conditional format support 2020-03-03 00:15:03 +08:00
xuri ad883caa0f
Resolve #580, revert commit 5ca7231ed4 2020-02-19 00:08:10 +08:00
xuri 5f5ec76740
Fix #551, handle empty rows in streaming reading 2019-12-31 01:01:16 +08:00
xuri 09485b3f9f
Improve code coverage unit tests 2019-12-29 16:02:31 +08:00
xuri 4e4a5b9b3e
Improve compatibility, fix workbook's rels ID calc error 2019-12-23 00:07:40 +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 75d66a03f3
Fix #482, font strike style support 2019-09-23 21:50:03 +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 407fb55c20
Update the Godoc 2019-08-21 23:03:34 +08:00
xuri 9c70d0ac86
Documentation updated, Go 1.10+ required 2019-08-11 00:36:14 +08:00
xuri cbe919fdf6
New feature: sparkline supported 2019-08-04 20:24:59 +08:00
xuri dc8210d4a7
Update GoDoc and typo fixed 2019-06-30 19:50:47 +08:00
xuri e124f6000a
Fix #425, handle empty font style format 2019-06-13 08:25:35 +08:00
xuri 821632cf89
Fix #424, refactor merged cells adjuster 2019-06-12 08:10:33 +08:00
xuri 421f945f51
Fixed #418, #420, #421, init adjust calculation chain support
Update testing case
2019-06-08 00:00:55 +08:00
xuri 3997dee1f5
Fix #411, change font size to float type 2019-06-07 09:16:55 +08:00
Harris b1c9884f6d Add the ability to change the default font
Closes #390
2019-05-23 17:01:30 -05:00
xuri f91f548614
Resolve #404, get sheet map by target rels. 2019-05-17 22:58:12 +08:00
xuri 0660f30cdd
godoc update and typo fixed 2019-04-20 14:57:50 +08:00
Michael 0f9170a03b Resolve #382, rewrite prepareSheetXML to scale linearly (#383)
* Rewrite prepareSheetXML to scale linearly

We don't need to backfill columns into every row for most purposes
Provided makeContiguousColumns for setting styles where we do
need it for a specific region.

Added a benchmark to monitor progress. For 50,000 rows this went
from about 11 seconds to 1 second. The improvements are more
dramatic as the row/column count increases.

* Assigning that row value was redundant
2019-04-16 14:50:16 +08:00
xuri f2df344739
Resolve #369,#370
add error return value

exported functions:

GetMergeCells
ProtectSheet
UnprotectSheet
UpdateLinkedValue
GetMergeCells
SetSheetVisible

inner functions:

workSheetReader
copySheet
2019-04-15 11:22:57 +08:00
xuri 40ff5dc1a7
refactor: handler error instead of panic,
Exported functions:

SetCellStyle
InsertCol
RemoveCol
RemoveRow
InsertRow
DuplicateRow
DuplicateRowTo
SetRowHeight
GetRowHeight
GetCellValue
GetCellFormula
GetCellHyperLink
SetCellHyperLink
SetCellInt
SetCellBool
SetCellFloat
SetCellStr
SetCellDefault
GetCellStyle
SetCellValue
MergeCell
SetSheetRow
SetRowVisible
GetRowVisible
SetRowOutlineLevel
GetRowOutlineLevel
GetRows
Columns
SearchSheet
AddTable
GetPicture
AutoFilter
GetColVisible
SetColVisible
GetColOutlineLevel
SetColOutlineLevel
SetColWidth
GetColWidth

inner functions:

adjustHelper
adjustMergeCells
adjustAutoFilter
prepareCell
setDefaultTimeStyle
timeToExcelTime
addDrawingChart
addDrawingVML
addDrawingPicture
getTotalRowsCols
checkRow
addDrawingShape
addTable
2019-03-23 20:08:06 +08:00
Veniamin Albaev dc01264562 Huge refactorig for consistent col/row numbering (#356)
* Huge refactorig for consistent col/row numbering

Started from simply changing ToALphaString()/TitleToNumber() logic and related fixes.
But have to go deeper, do fixes, after do related fixes and again and again.

Major improvements:

1. Tests made stronger again (But still be weak).
2. "Empty" returns for incorrect input replaces with panic.
3. Check for correct col/row/cell naming & addressing by default.
4. Removed huge amount of duplicated code.
5. Removed ToALphaString(), TitleToNumber() and it helpers functions at all,
and replaced with SplitCellName(), JoinCellName(), ColumnNameToNumber(), ColumnNumberToName(), CellNameToCoordinates(), CoordinatesToCellName().
6. Minor fixes for internal variable naming for code readability (ex. col, row for input params, colIdx, rowIdx for slice indexes etc).

* Formatting fixes
2019-03-20 00:14:41 +08:00
Michael W. Mitton 5dd00b9a00 Do not create a blank fill if no fill is specified in the style format 2019-01-09 10:12:53 -05:00
xuri fabd9d013f
README updated 2019-01-01 13:20:14 +08:00
xuri 1c45425f12
resolve #276, add OfficeOpenXML-XMLSchema-Strict mode support 2018-10-17 00:28:31 +08:00
xuri 3e004d900b
Comments style changed. 2018-09-14 00:58:48 +08:00
xuri 13a9769cc5
Comments style changed. 2018-09-14 00:44:23 +08:00
xuri 2f146c923c
Comments style changed. 2018-09-14 00:35:47 +08:00
xuri b4a6e61ec3
Fix golint errors under confidence 0.1 2018-09-12 15:47:56 +08:00
xuri ec37b114c3
Fixes #256 and format document. 2018-08-06 10:21:24 +08:00
Alex Whitney db7a605cf8 Use min/mid/max value for 2 and 3 color scale conditional formatting 2018-07-25 10:47:14 -04:00
xuri 79dfe1c307
GoDoc updated. 2018-07-13 17:40:47 +08:00
xuri d6468fc114
- Initialize theme support;
- RGBA, HSL color convert has been added;
- go test updated
2018-07-07 15:59:48 +08:00
xuri 9cb0e9308b
- Update Travis CI to include GOARCH=386 tests, relate issue #239 and #244;
- Fix doc typo
2018-06-30 16:44:09 +08:00
xuri 9e463b4614
- Add error return value for functions: `AddChart()`, `AddComment()`, `AddPicture()`, `AddShape()`, `AddTable()` and `SetConditionalFormat()`
- go test has been updated
2018-05-27 11:25:55 +08:00
xuri e8961f0aff
- Bugfix: set font family not works, relate issue #222;
- Remove useless function `replaceWorkSheetsRelationshipsNameSpace()`;
- Make test cases use strict error checking
2018-05-08 10:36:13 +08:00
Lunny Xiao 38ad20efc1
save bytes on memory instead of string 2018-05-07 16:12:51 +08:00
Ri Xu 200437d778
Fix document typo. 2018-05-03 10:01:41 +08:00
Ri Xu 9ee57fdb38
Fix typo and adding Chinese version document. 2018-04-23 00:14:58 +08:00
Ri Xu ecc3adf22a
- Add protection properties associated with the cell support, relate issue #191;
- godoc and go test has been updated
2018-03-07 12:56:18 +08:00
Ri Xu 638bd44dd5
- gofmted with -s;
- Fix ineffectual assignments in Go code;
- Godoc has been updated
2018-01-31 11:12:43 +08:00
Martin Sandve Alnæs e556c25047 Avoid looping over unused rows and columns in SetCellStyle.
The recent improvement to SetCellStyle still loops
over all the rows before the area, moving the area checks
into the loop is more concise and faster.

Since the loop now covers the correct area by construction,
the inner loop check checkCellInArea is no longer needed.
2018-01-29 12:39:06 +01:00
mbresson 317ef65381 make SetCellStyle quicker by skipping conversions in checkCellInArea, and skipping area checks when we are sure the cell can't be before or past the current row/col
Signed-off-by: Matthieu Bresson
2018-01-19 17:49:09 +08:00
Ri Xu 76366fc1d9
Travis CI config updated and typo fixed. 2017-12-01 16:31:27 +08:00
Ri Xu 07a4140098
- 24 hour time format supported, relate issue #163;
- godoc and go test updated
2017-12-01 15:47:39 +08:00
Ri Xu 905be463ed
Improve code readability. 2017-09-30 17:07:59 +08:00
Ri Xu e820388d70
Handle coordinate parse exception, relate issue #122. 2017-09-19 11:59:33 +08:00
Ri Xu f05f799f8d
- API changed, use worksheet name instead of "sheet" + index, related issue #25, #43, #47, #51, #89, #101, #116 and #120.
- go test updated
2017-09-13 22:00:33 +08:00
Ri Xu 77af25295e
- Conditional format with formula support, relate issue #75;
- go test and readme update
2017-08-18 20:55:27 +08:00
Ri Xu 845e339755
Document updated. 2017-08-11 23:39:59 +08:00
Ri Xu 67636039f6
- Init conditional format support, relate issue #75;
- go test and godoc updated
2017-08-11 23:15:33 +08:00
Ri Xu 5cf3725f02
Add missing element `xfId` of the styles to fix issue #93. 2017-08-07 10:42:10 +08:00
Ri Xu 961996a813
- Fix `completeCol()` make extra rows, relate issue #87;
- godoc updated
2017-07-27 15:38:58 +08:00
Ri Xu 4a74951e81
- Support set custom number format, relate issue #86;
- go test and godoc updated
2017-07-27 11:46:04 +08:00
Ri Xu 8493fea373
- Add number format code with unicode values, relate issue #86;
- godoc updated
2017-07-26 18:37:00 +08:00
Ri Xu 4f942255e4
- Fix missing element in worksheet, workbook and styles. Related issue #81;
- Format code and update readme
2017-07-15 20:03:44 +08:00
Ri Xu 4b7d21bb63
Currency format code added. 2017-07-15 16:38:29 +08:00