Commit Graph

185 Commits

Author SHA1 Message Date
xuri 055349d8a6
Fix a v2.8.1 regression bug, error on duplicate rows, if conditional formatting or data validation has multiple cell range reference
- Update unit tests
2024-04-26 00:23:10 +08:00
Nima 3e636ae7b2
This closes #1874, reduces memory usage for the GetRows function (#1875)
- Avoid allocate memory for reading continuously empty rows on the tail of the worksheet
2024-04-11 23:12:56 +08:00
hu5ky 4eb088cf73
This fix performance impact introduced in #1692 (#1849)
Co-authored-by: chun.zhang2 <chun.zhang2@geely.com>

- This fix speed slowdown and memory usage increase base on the reverts commit 6220a798fd
- Fix panic on read workbook with internal row element without r attribute
- Update the unit tests
2024-03-15 11:36:34 +08:00
陈王 9d4c2e60f6
This closes #1825, made AddDataValidation and DeleteDataValidation functions concurrency safe (#1828)
- Remove the receiver of internal coordinatesToRangeRef, squashSqref and flatSqref functions
- Update unit tests

Co-authored-by: chenwang <chenwang@shinsson.com>
2024-03-01 10:12:17 +08:00
xuri 688808b2b4
This closes #1819, formula calculation engine support array formulas
- Improve the defined name and table name validation rules
- Rename internal variable names to avoid the same with Go 1.21's built-in min and max functions
- Simplify data type conversion in internal code
- Update GitHub Actions workflow configuration, test on Go 1.22.x, and disable Go module cache
- Update dependencies module
2024-02-26 02:22:51 +08:00
Vivek Kairi ee2ef152d9
This closes #1815, cell value reading functions inherit the Options settings of the OpenReader (#1816)
Co-authored-by: Vivek Kairi <vivek@zerodhafundhouse.com>
2024-02-15 13:30:07 +08:00
3zmx 50e23df865
ref #65, support _xlfn.ANCHORARRAY formula function (#1784)
- Initial formula array calculation support
- Update unit test and documentation
2024-01-18 15:31:43 +08:00
xuri 792656552b
This closes #1777, fix the GetStyle or GetConditionalStyle function to returns incorrect DecimalPlaces field value
- Update documentation for the NewStyle function
- Update unit tests
- Update dependencies Go module
- Update GitHub workflow dependencies package version
- Update copyright agreement statement
2024-01-09 20:56:20 +08:00
天爱有情 18a160c5be
Support unset custom row height if height value is -1 (#1736)
- Return error if get an invalid row height value
- Update unit tests and update documentation of the SetRowHeigth function
2023-12-02 12:03:09 +08:00
Bram Vanbilsen 866e7fd9e1
This closes #1729, support copy conditional format and data validation on duplicate row (#1733) 2023-11-29 00:13:39 +08:00
lujin 6220a798fd
This closes #1723, fix panic on read workbook in some cases (#1692)
- Fix panic on read workbook with internal row element without r attribute
- Check worksheet XML before get all cell value by column or row
- Update the unit tests
2023-11-18 16:44:45 +08:00
rjtee b41a6cc3cd
Support to adjust formula cross worksheet on inserting/deleting columns/rows (#1705) 2023-11-01 00:52:18 +08:00
rjtee cf3e0164d9
Support adjust formula for entire cols/rows reference (#1702)
- Update the unit tests
2023-10-29 13:40:21 +08:00
rjtee a8cbcfa39b
This closes #1306 and closes #1615 (#1698)
- Support adjust formula on inserting/deleting columns/rows
2023-10-24 00:05:52 +08:00
xuri 1c23dc3507
This sorted exported error constants by name and listed them in one place 2023-09-28 08:53:54 +08:00
xuri e3b7dad69a
Introduce the new exported function `AddSlicer` for adding table slicer
- Fix a v2.8.0 regression bug, generate workbook corruption caused by incorrect MRU colors style parts
- Fix corrupted workbooks generated when adding tables in some cases
- Added several exported extension list child element URI constants
- Move part of the internal constant and variables definition to the template source code file
- Updated unit tests
2023-09-16 12:21:11 +08:00
lidp20 e2c7416292
This closes #1565, support adjust formula when instering columns and rows (#1567) 2023-07-04 00:06:37 +08:00
xuri 121ac17ca0
This fixed incorrect formula calculation exception expected result
- Simplify and remove duplicate code for optimization
- Update documentation comments with typo fix
- Handle error return to save the workbook
- Add file path length limitation details in the error message
2023-05-30 00:19:12 +08:00
xuri a246db6a40
This closes #279, refs #1536, change the default point to pixels conversion factor 2023-05-19 19:53:18 +08:00
xuri 93c72b4d55
This optimizes internal functions signature and mutex declarations 2023-04-24 00:02:13 +08:00
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