summaryrefslogtreecommitdiff
path: root/lib.go
Commit message (Collapse)AuthorAge
* Fix the error on getting the range of merged cells on the worksheet which ↵xuri2022-10-28
| | | | | | | | 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
* Go 1.16 and later required, migration of deprecation package `ioutil`xuri2022-10-13
| | | | | | - Improving performance for stream writer `SetRow` function, reduces memory usage over and speedup about 19% - Update dependencies module - Update GitHub workflow
* This closes #1368, fixes number parsing issue, adds support for create a 3D ↵xuri2022-10-12
| | | | line chart
* This closes #1358, made a refactor with breaking changes, see details:xuri2022-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This made a refactor with breaking changes: Motivation and Context When I decided to add set horizontal centered support for this library to resolve #1358, the reason I made this huge breaking change was: - There are too many exported types for set sheet view, properties, and format properties, although a function using the functional options pattern can be optimized by returning an anonymous function, these types or property set or get function has no binding categorization, so I change these functions like `SetAppProps` to accept a pointer of options structure. - Users can not easily find out which properties should be in the `SetSheetPrOptions` or `SetSheetFormatPr` categories - Nested properties cannot proceed modify easily Introduce 5 new export data types: `HeaderFooterOptions`, `PageLayoutMarginsOptions`, `PageLayoutOptions`, `SheetPropsOptions`, and `ViewOptions` Rename 4 exported data types: - Rename `PivotTableOption` to `PivotTableOptions` - Rename `FormatHeaderFooter` to `HeaderFooterOptions` - Rename `FormatSheetProtection` to `SheetProtectionOptions` - Rename `SparklineOption` to `SparklineOptions` Remove 54 exported types: `AutoPageBreaks`, `BaseColWidth`, `BlackAndWhite`, `CodeName`, `CustomHeight`, `Date1904`, `DefaultColWidth`, `DefaultGridColor`, `DefaultRowHeight`, `EnableFormatConditionsCalculation`, `FilterPrivacy`, `FirstPageNumber`, `FitToHeight`, `FitToPage`, `FitToWidth`, `OutlineSummaryBelow`, `PageLayoutOption`, `PageLayoutOptionPtr`, `PageLayoutOrientation`, `PageLayoutPaperSize`, `PageLayoutScale`, `PageMarginBottom`, `PageMarginFooter`, `PageMarginHeader`, `PageMarginLeft`, `PageMarginRight`, `PageMarginsOptions`, `PageMarginsOptionsPtr`, `PageMarginTop`, `Published`, `RightToLeft`, `SheetFormatPrOptions`, `SheetFormatPrOptionsPtr`, `SheetPrOption`, `SheetPrOptionPtr`, `SheetViewOption`, `SheetViewOptionPtr`, `ShowFormulas`, `ShowGridLines`, `ShowRowColHeaders`, `ShowRuler`, `ShowZeros`, `TabColorIndexed`, `TabColorRGB`, `TabColorTheme`, `TabColorTint`, `ThickBottom`, `ThickTop`, `TopLeftCell`, `View`, `WorkbookPrOption`, `WorkbookPrOptionPtr`, `ZeroHeight` and `ZoomScale` Remove 2 exported constants: `OrientationPortrait` and `OrientationLandscape` Change 8 functions: - Change the `func (f *File) SetPageLayout(sheet string, opts ...PageLayoutOption) error` to `func (f *File) SetPageLayout(sheet string, opts *PageLayoutOptions) error` - Change the `func (f *File) GetPageLayout(sheet string, opts ...PageLayoutOptionPtr) error` to `func (f *File) GetPageLayout(sheet string) (PageLayoutOptions, error)` - Change the `func (f *File) SetPageMargins(sheet string, opts ...PageMarginsOptions) error` to `func (f *File) SetPageMargins(sheet string, opts *PageLayoutMarginsOptions) error` - Change the `func (f *File) GetPageMargins(sheet string, opts ...PageMarginsOptionsPtr) error` to `func (f *File) GetPageMargins(sheet string) (PageLayoutMarginsOptions, error)` - Change the `func (f *File) SetSheetViewOptions(sheet string, viewIndex int, opts ...SheetViewOption) error` to `func (f *File) SetSheetView(sheet string, viewIndex int, opts *ViewOptions) error` - Change the `func (f *File) GetSheetViewOptions(sheet string, viewIndex int, opts ...SheetViewOptionPtr) error` to `func (f *File) GetSheetView(sheet string, viewIndex int) (ViewOptions, error)` - Change the `func (f *File) SetWorkbookPrOptions(opts ...WorkbookPrOption) error` to `func (f *File) SetWorkbookProps(opts *WorkbookPropsOptions) error` - Change the `func (f *File) GetWorkbookPrOptions(opts ...WorkbookPrOptionPtr) error` to `func (f *File) GetWorkbookProps() (WorkbookPropsOptions, error)` Introduce new function to instead of existing functions: - New function `func (f *File) SetSheetProps(sheet string, opts *SheetPropsOptions) error` instead of `func (f *File) SetSheetPrOptions(sheet string, opts ...SheetPrOption) error` and `func (f *File) SetSheetFormatPr(sheet string, opts ...SheetFormatPrOption
* This closes #1360, closes #1361xuri2022-09-28
| | | | | | | - 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
* Using the specialized name in a variable and making comments clearxuri2022-09-18
| | | | - Add JSON tags for `AppProperties`, `PivotTableOption` and `PivotTableField` structure
* This closes #1244 and closes #1314, improving the compatibility with Google ↵xuri2022-08-13
| | | | | | Sheet - Format code with `gofmt`
* Fix potential file corrupted and change worksheet name case-insensitivexuri2022-07-18
| | | | | | - 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
* adjust `ErrColumnNumber`, rename `TotalColumns` to `MaxColumns` and add new ↵MJacred2022-07-14
| | | | | constant `MinColumns` (#1272) Signed-off-by: Benjamin Lösch <loesch.benny92@gmx.de>
* refactor: replace strings.Replace with strings.ReplaceAll (#1250)Eng Zer Jun2022-06-12
| | | | | | | strings.ReplaceAll(s, old, new) is a wrapper function for strings.Replace(s, old, new, -1). But strings.ReplaceAll is more readable and removes the hardcoded -1. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* ref #65, new formula functions: T.INV and T.INV.2Txuri2022-04-04
| | | | - Typo fixed
* Format code, update documentation and remove exported variable `XMLHeaderByte`xuri2022-03-24
|
* This improved formula calculate precision and added zero placeholder number ↵xuri2022-03-19
| | | | format support
* This fix scientific notation and page setup fields parsing issuexuri2022-03-18
|
* Fixed parsing decimal precision issuexuri2022-02-18
|
* This closes #1148, resolve limitations when adding VBA project to the workbookxuri2022-02-17
| | | | | | | | 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
* Ref: #660, #764, #1093, #1112, #1133 This improve number format supportxuri2022-02-13
| | | | | | - Introduced NFP (number format parser) dependencies module - Initialize custom dates and times number format support - Dependencies module upgraded
* Fix file corrupted in some cases, check file extension and format codexuri2022-01-23
| | | | | | 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`
* This closes #1119, style parsing issue fixedxuri2022-01-15
|
* Typo fix, rename exported constants, dependencies modules and copyright updatexuri2022-01-09
| | | | Rename exported constants `NameSpaceDublinCoreMetadataIntiative` to `NameSpaceDublinCoreMetadataInitiative`
* This closes #1096, memory usage optimization and another 4 changesxuri2021-12-27
| | | | | | | | - 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
* Export 7 errors so users can act differently on different type of errorsxuri2021-12-07
|
* ref #65: new formula function PRICExuri2021-11-17
| | | | | - fix COUPPCD result accuracy issue - update close spreadsheet example in documentation and README
* This closes #1057, merge column styles to reduce spreadsheet sizexuri2021-11-14
|
* This closes #1059, represent boolean in XML as 0/1 rather than true/falsexuri2021-11-13
|
* ref #65: new formula functions PERCENTRANK.EXC, PERCENTRANK.INC and PERCENTRANKxuri2021-11-09
|
* This closes #833, closes #845, and closes #1022, breaking changesxuri2021-09-19
| | | | | | - Close spreadsheet and row's iterator required - New options `WorksheetUnzipMemLimit` have been added - Improve streaming reading performance, memory usage decrease about 93.7%
* Preserve XML control character in bstrUnmarshal resultxuri2021-08-28
|
* This closes #989, closes #990xuri2021-08-17
| | | | | New API: `SetRowStyle` support for set style for the rows Update documentation for the `GetRows`, `SetCellStyle` and `SetColStyle`
* This closes #844, support get shared formularaochq2021-08-15
|
* Improve security and simplify codexuri2021-08-15
| | | | | | | - Make variable name more semantic - Reduce cyclomatic complexities for the formula calculate function - Support specified unzip size limit on open file options, avoid zip bombs vulnerability attack - Typo fix for documentation and error message
* Speed up merge cellsthree2021-08-13
|
* This closes #979, fix the data validation deletion issue and tidy the ↵xuri2021-08-06
| | | | internal function in the source code
* Fix code security issuexuri2021-07-20
|
* - Support concurrency iterate rows and columnsxuri2021-07-05
| | | | | - Rename exported field `File.XLSX` to `File.Pkg` - Exported error message
* encode the escaped string literal which not permitted in an XML 1.0 documentxuri2021-06-16
|
* string pattern match context check instead of regex lookahead assertionxuri2021-06-13
|
* skip XML control character in the escape literal string, and update dependenciesxuri2021-06-12
|
* support escaped string literal basic string and use GitHub Action instead of ↵xuri2021-06-11
| | | | | | TravisCI - Note that: travis-ci.org will shutdown on June 15th, 2021, and I don't have enough permission to migrate this project to travis-ci.com currently
* This closes #652, new SetColWidth API, support set column width in stream ↵xuri2021-05-10
| | | | writing mode, and export error message
* Fixe issue generated file corrupted caused by incorrect default XML ↵xuri2021-04-30
| | | | namespace attributes
* Fixed #819, read empty after streaming data writingxuri2021-04-08
| | | | #65 fn: IMAGINARY, IMARGUMENT, IMCONJUGATE and IMDIV
* Go 1.15 and later required, #65 fn: IMABS, IMCOS, IMCOSH, IMCOT, IMCSC, ↵xuri2021-04-04
| | | | IMCSCH, IMEXP, IMLN and IMLOG10
* #65 fn: N, PERCENTILE.INC and Txuri2021-03-30
| | | | typo fixed
* This improves compatibility for absolute XML path, Windows-style directory ↵xuri2021-02-27
| | | | separator and inline namespace;
* lint issue fixed and new formula function: ATAN, AVERAGE, AVERAGEA, CONCAT, ↵xuri2021-02-15
| | | | CONCATENATE, COUNT, COUNTBLANK, MAX
* This closes #774, closes #775 and closes #776xuri2021-02-02
| | | | | | | | - 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`
* new formula fn: IF, LEN; not equal operator support and faster numeric ↵xuri2021-01-27
| | | | precision process
* Compatibility improvement: parse document core part (workbook) dynamicallyxuri2020-11-04
|
* optimize memory allocation (#722)Ted2020-11-03
| | | | | | | | | | | | | | | * optimize marshal * optimize mem alloc * add benchmark testing * add NewSheetWithRowNum testing * sync struct fields order * add BenchmarkNewSheetWithStreamWriter * delete NewSheetWithRowNum and benchmark test