Commit Graph

165 Commits

Author SHA1 Message Date
xuri 12645e7116
This fixes #1461, supports 0 row height and column width
- Increase max cell styles to 65430
- Add new exported error variable `ErrCellStyles`
- Update unit tests, support test under Go 1.20.x
2023-02-03 00:08:46 +08:00
xuri 917e6e19d6
This roundup time value when a millisecond great than 500 to fix the accuracy issue
- Correction example in the documentation of set cell formula
- Rename the internal function `parseOptions` to `getOptions`
- Update unit tests
2023-01-20 03:10:04 +00:00
xuri b39626fae9
This fixed worksheet protection issue
- Update example code in the documentation
- Update unit tests
- Rename `PictureOptions` to `GraphicOptions`
- Adjust partial options fields data types for the `PictureOptions` and `Shape` structure
- Update dependencies module
2023-01-02 11:47:31 +08:00
郭伟匡 6a5ee811ba
This closes #1425, breaking changes for sheet name (#1426)
- Checking and return error for invalid sheet name instead of trim invalid characters
- Add error return for the 4 functions: `DeleteSheet`, `GetSheetIndex`, `GetSheetVisible` and `SetSheetName`
- Export new error 4 constants: `ErrSheetNameBlank`, `ErrSheetNameInvalid`, `ErrSheetNameLength` and `ErrSheetNameSingleQuote`
- Rename exported error constant `ErrExistsWorksheet` to `ErrExistsSheet`
- Update unit tests for 90 functions: `AddChart`,  `AddChartSheet`, `AddComment`, `AddDataValidation`, `AddPicture`, `AddPictureFromBytes`, `AddPivotTable`, `AddShape`, `AddSparkline`, `AddTable`, `AutoFilter`, `CalcCellValue`, `Cols`, `DeleteChart`, `DeleteComment`, `DeleteDataValidation`, `DeletePicture`, `DeleteSheet`, `DuplicateRow`, `DuplicateRowTo`, `GetCellFormula`, `GetCellHyperLink`, `GetCellRichText`, `GetCellStyle`, `GetCellType`, `GetCellValue`, `GetColOutlineLevel`, `GetCols`, `GetColStyle`, `GetColVisible`, `GetColWidth`, `GetConditionalFormats`, `GetDataValidations`, `GetMergeCells`, `GetPageLayout`, `GetPageMargins`, `GetPicture`, `GetRowHeight`, `GetRowOutlineLevel`, `GetRows`, `GetRowVisible`, `GetSheetIndex`, `GetSheetProps`, `GetSheetVisible`, `GroupSheets`, `InsertCol`, `InsertPageBreak`, `InsertRows`, `MergeCell`, `NewSheet`, `NewStreamWriter`, `ProtectSheet`, `RemoveCol`, `RemovePageBreak`, `RemoveRow`, `Rows`, `SearchSheet`, `SetCellBool`, `SetCellDefault`, `SetCellFloat`, `SetCellFormula`, `SetCellHyperLink`, `SetCellInt`, `SetCellRichText`, `SetCellStr`, `SetCellStyle`, `SetCellValue`, `SetColOutlineLevel`, `SetColStyle`, `SetColVisible`, `SetColWidth`, `SetConditionalFormat`, `SetHeaderFooter`, `SetPageLayout`, `SetPageMargins`, `SetPanes`, `SetRowHeight`, `SetRowOutlineLevel`, `SetRowStyle`, `SetRowVisible`, `SetSheetBackground`, `SetSheetBackgroundFromBytes`, `SetSheetCol`, `SetSheetName`, `SetSheetProps`, `SetSheetRow`, `SetSheetVisible`, `UnmergeCell`, `UnprotectSheet` and
`UnsetConditionalFormat`
- Update documentation of the set style functions

Co-authored-by: guoweikuang <weikuang.guo@shopee.com>
2022-12-23 00:54:40 +08:00
xuri ac564afa56
Remove internal error log print, throw XML deserialize error 2022-11-13 00:40:04 +08:00
xuri bd5dd17673
This is a breaking change, remove partial internal error log print, throw XML deserialize error
- Add error return value for the `GetComments`, `GetDefaultFont` and `SetDefaultFont` functions
- Update unit tests
2022-11-12 00:16:23 +08:00
xuri 4998b7b929
This closes #1383, skip empty rows when saving the spreadsheet to reduce file size 2022-11-03 00:23:48 +08:00
xuri a410b22bdd
Fix the error on getting the range of merged cells on the worksheet which contains one cell merged cell range
- Parse workbook default theme for custom theme color support in the feature
- Variables name typo fix
- Add system foreground and background color as RGB in the IndexedColorMapping list
2022-10-28 00:31:55 +08:00
xuri f44153ea46
This closes #1377, stream writer writes inline string type for string cell value
- Add `CellTypeFormula`, `CellTypeInlineString`, `CellTypeSharedString` and remove `CellTypeString` in `CellType` enumeration
- Unit tests updated
2022-10-25 10:24:45 +08:00
xuri 14c6a198ce
Support get cell value which contains a date in the ISO 8601 format
- Support set and get font color with indexed color
- New export variable `IndexedColorMapping`
- Fix getting incorrect page margin settings when the margin is 0
- Update unit tests and comments typo fixes
- ref #65, new formula functions: AGGREGATE and SUBTOTAL
2022-10-24 00:52:09 +08:00
xuri 7363c1e333
Go 1.16 and later required, migration of deprecation package `ioutil`
- Improving performance for stream writer `SetRow` function,  reduces memory usage over and speedup about 19%
- Update dependencies module
- Update GitHub workflow
2022-10-13 00:13:36 +08:00
xuri efcf599dfe
This closes #1360, closes #1361
- Fix default number format parse issue with a long string of digits
- Fix creating a sheet with an empty name cause a corrupted file
- The `GetCellStyle` function no longer return master cell style of the merge cell range
- Using the specialized name in variables and functions
2022-09-28 00:04:17 +08:00
xuri b6cc43d824
This makes 6 functions concurrency safety
- These 6 functions now support concurrency safe: SetColWidth, GetColWidth, SetColVisible, GetColVisible, SetColStyle and GetColStyle
2022-09-11 00:04:04 +08:00
xuri 75ce231728
This closes #1323, an error will be returned when set the not exist style ID 2022-09-01 00:41:52 +08:00
Kostya Privezentsev 18cd63a548
This is a breaking change closes #1332 (#1333)
This use `InsertRows` instead of `InsertRow`, and using `InsertCols` instead of `InsertCol`
2022-08-31 00:02:48 +08:00
davidborry bef49e40ee
This closes #1330 update non existing sheet error messages (#1331) 2022-08-28 00:16:41 +08:00
xuri d1e76fc432
This closes #1319, fix calculate error for formula with negative symbol
- Update unit test and comment for the functions
2022-08-17 10:59:52 +08:00
xuri 551fb8a9e4
This closes #1244 and closes #1314, improving the compatibility with Google Sheet
- Format code with `gofmt`
2022-08-13 11:21:59 +08:00
Thomas Charbonnel ed91cddea5
This closes #1296, add new function `GetRowOpts` for stream reader (#1297)
- Support get rows properties by `GetRowOpts` function
- New exported constant `MaxCellStyles`
2022-08-11 00:20:48 +08:00
xuri ebea684ae5
Fix potential file corrupted and change worksheet name case-insensitive
- Using sheet ID instead of sheet index when delete the cell in calculation chain
- Update documentation for exported functions
- Using `sheet` represent the sheet name in the function parameters
2022-07-18 00:21:34 +08:00
xuri b69da76063
ref #65, new formula functions: NETWORKDAYS, NETWORKDAYS.INTL, and WORKDAY 2022-06-16 00:01:32 +08:00
xuri 773d4afa32
This closes #1217, support update cell hyperlink
Ref #1129, make `SetRowStyle` overwrite style of the cells
2022-05-01 12:28:36 +08:00
xuri 8a335225c7
Format code, update documentation and remove exported variable `XMLHeaderByte` 2022-03-24 00:19:30 +08:00
xuri 94f197c4fe
This improved formula calculate precision and added zero placeholder number format support 2022-03-19 00:05:47 +08:00
xuri 14b461420f
This fix scientific notation and page setup fields parsing issue 2022-03-18 00:52:10 +08:00
xuri 56aa6b8263
ref #65, new formula functions and read boolean data type cell value support
* added 3 new formula functions: BETAINV, BETA.INV, F.INV.RT
2022-03-08 00:03:02 +08:00
xuri f87c39c41d
This closes #1148, resolve limitations when adding VBA project to the workbook
Added two exported functions `SetWorkbookPrOptions` and `GetWorkbookPrOptions` to support setting and getting the code name property of the workbook
Re-order fields of the workbook properties group to improve the compatibility
Go Modules dependencies upgrade
Put workbook related operating in new `workbook.go` source code
Library introduction docs block updated
2022-02-17 00:09:11 +08:00
xuri 3ee3c38f9c
Fix file corrupted in some cases, check file extension and format code
Fix file corrupted when save as in XLAM / XLSM / XLTM / XLTX extension in some case
New exported error ErrWorkbookExt has been added, and check file extension on save the workbook
Format source code with `gofumpt`
2022-01-23 00:48:26 +08:00
xuri 74f6ea94ea
ref #1054, breaking change for the column and row's iterator
This removed 3 exported functions: `TotalCols`, `CurrentCol` and `CurrentRow`
2022-01-19 00:51:09 +08:00
xuri 4daa6ed0b4
Breaking change: remove `TotalRows` of row iterator and performance optimization
Reduce allocation memory 20%, and 80% GC times for the row's iterator
2022-01-17 08:05:52 +08:00
Dokiy 67127883dd
Fix adjustMergeCells not modifies cell rect (#1118) 2022-01-14 00:28:31 +08:00
xuri 891e5baac1
ref #1096, reduce memory usage by about 50% for large data spreadsheet 2022-01-11 00:31:11 +08:00
xuri 2245fccca0
Typo fix, rename exported constants, dependencies modules and copyright update
Rename exported constants `NameSpaceDublinCoreMetadataIntiative` to `NameSpaceDublinCoreMetadataInitiative`
2022-01-09 00:20:42 +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 e0c6fa1beb
Update docs for SetSheetStyle, and added 2 formula functions
ref #65: new formula functions DURATION and MDURATION
fix incorrect example in SetSheetStyle docs
2021-12-04 13:11:01 +08:00
li 60b13affbd
Support get current row/col and total rows/cols in the stream reader (#1054) 2021-11-05 00:01:34 +08:00
xuri de38402f74
This closes #1031, fix small float parsed error in some case
- new formula function: YEARFRAC, ref #65
- update the codecov version
- remove unused variable
2021-10-15 21:45:46 +08:00
xuri 490f3063c2
This closes #1026, time parse accuracy issue and typo fixed 2021-09-26 00:07:40 +08:00
xuri 790c363cce This closes #833, closes #845, and closes #1022, breaking changes
- Close spreadsheet and row's iterator required
- New options `WorksheetUnzipMemLimit` have been added
- Improve streaming reading performance, memory usage decrease about 93.7%
2021-09-19 11:06:54 +08:00
xuri 32b23ef42d
This closes #998
- Support text comparison in the formula, also ref #65
- `GetCellValue`, `GetRows`, `GetCols`, `Rows` and `Cols` support to specify read cell with raw value, ref #621
- Add missing properties for the cell formula
- Update the unit test for the `CalcCellValue`
2021-09-05 11:59:50 +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
three f6f14f507e
Speed up merge cells 2021-08-13 01:32:44 +08:00
xuri f62c45fe0c
This closes #848 and closes #852, fix reading decimals precision 2021-07-12 00:02:39 +08:00
xuri b7fece5173
Support concurrency add picture 2021-07-06 00:31:04 +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
strong c62ced7ca7
fix getRowHeight actually get the height of the next row (#860) 2021-06-13 14:42:09 +08:00
xuri bffb5d6b41
make the caller of `getRowHeight` function adapt row number change, update comment: use rows number instead of rows index. 2021-06-13 14:38:01 +08:00
xuri d932e62a12
This closes #855, fix missing formula cell when getting rows value 2021-06-05 00:06:14 +08:00
william 2f74ec171d fix the bug when there was no count attribute in sharedStrings file 2021-05-24 15:27:36 +08:00