Commit Graph

1000 Commits

Author SHA1 Message Date
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 0e657c887b
This closes #1368, fixes number parsing issue, adds support for create a 3D line chart 2022-10-12 00:06:09 +08:00
Harrison c02346bafc
This closes #1047, stream writer support set panes (#1123)
- New exported error `ErrStreamSetPanes` has been added
2022-10-11 00:05:02 +08:00
charles.deng 2f5704b114
Stream writer support to set inline rich text cell (#1121)
Co-authored-by: zhengchao.deng <zhengchao.deng@meican.com>
2022-10-10 00:11:18 +08:00
xuri b1e776ee33
Support to set summary columns to appear to the right of detail in an outline
- Simplify calculation engine code
- Update documentation for the functions
- Update dependencies module
2022-10-08 22:08:16 +08:00
Joseph Watson 57051326d0
This closes #1365, normalize the sheet name (#1366)
Signed-off-by: Joseph Watson <jtwatson@linux-consulting.us>
2022-10-07 12:11:59 +08:00
xuri 53a495563a
This closes #1358, made a refactor with breaking changes, see details:
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
2022-09-29 22:04:50 +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
Zitao addcc1a0b2
Fix cpu usage problem of stream writer when merging cells (#1359)
Co-authored-by: zzt <zhangzitao@meican.com>
2022-09-23 00:02:45 +08:00
invzhi 74dad51cfc
This closes #1354, stream writer will apply style in `RowOpts` for each cell (#1355)
Co-authored-by: Tianzhi Jin <tianzhi.jin@iglooinsure.com>
2022-09-21 00:29:34 +08:00
xuri 3f702999e6
Using the specialized name in a variable and making comments clear
- Add JSON tags for `AppProperties`, `PivotTableOption` and `PivotTableField` structure
2022-09-18 00:07:15 +08:00
Artem Tarasenko 73cc4bd449
This closes #1345, support set custom line color in the charts (#1346) 2022-09-14 00:05:05 +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
dafengge0913 c72fb747b8
Fix DeleteComment slice bounds out of range (#1343) 2022-09-10 13:05:34 +08:00
xuri fb1aab7add
This closes #744, the `Save`, `Write` and `WriteTo` function accept saving options 2022-09-08 22:20:21 +08:00
xuri 0c5cdfec18
This closes #1293, add new function `GetColStyle`
- Fix generate workbook corruption after insert cols/rows in some case
- Update unit tests
- Update dependencies module
2022-09-07 00:18:16 +08:00
xuri 961a3e8933
Fix get image content was empty after inserting image 2022-09-06 14:38:09 +08:00
xuri 00470c17d9
This closes #1338, fix apply AM/PM format issue 2022-09-03 20:16:35 +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
chenliu1993 f8667386dc
This closes #827, add new functions `GetDataValidations` and `GetConditionalFormats` (#1315)
Signed-off-by: chenliu1993 <13630583107@163.com>
2022-08-27 00:45:46 +08:00
Cooper de Nicola 0e9378fec2
This closes #1247, add new function `SetSheetCol` for set worksheet column values (#1320)
Signed-off-by: cdenicola <cooper.denicola@instabase.com>
Co-authored-by: cdenicola <cooper.denicola@instabase.com>
2022-08-25 09:34:29 +08:00
xuri cb8bca0e92
This closes #1290 and closes #1328
- Add new smooth field in chart format parameter, support specify if smooth line chart
- Fix decimal number format round issue with build-in number format
2022-08-24 00:00:47 +08:00
xuri ab12307393
This made library allowing insert EMZ and WMZ format image
- Update dependencies module
2022-08-21 01:09:32 +08:00
Sangua633 cfa2d603dd
Support encrypt workbook with password #199 (#1324) 2022-08-20 15:51:03 +08:00
NaturalGao 76f336809f
This closes #849, add new function `DeleteComment` for delete comment (#1317)
- Update unit tests for the delete comment
- Add 3 errors function for error messages
2022-08-19 23:24:13 +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
xuri 8152bbb2ce
This closes #1312, #1313, fix number format issue
- Add supported options in the docs of the functions `SetSheetPrOptions` and `GetSheetPrOptions`
- Add go1.19 unit test settings, and made the test case compatible with go1.19
- Update dependencies module
2022-08-12 00:32:51 +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
EE b8ceaf7bf6
This reduces memory usage and speedup the `AddComment` function (#1311)
By load only once for existing comment shapes, improving performance for adding comments in the worksheet
2022-08-10 10:35:33 +08:00
xuri e07dac5c2e
Add new exported `ColorMappingType` used for color transformation
Using `ColorMappingType` color transformation types enumeration for tab color index, ref #1285
2022-08-06 15:23:03 +08:00
Thomas Charbonnel 4a029f7e36
This closes #1299 skip write nil values in SetRow (#1301)
Co-authored-by: Thomas Charbonnel <github@charbonnel.email>
2022-08-04 16:50:33 +08:00
xuri 504d469d3d
This closes #1298, fix doc properties missing after creating new worksheet 2022-08-03 00:42:16 +08:00
Thomas Charbonnel fd0eb2bcbf
This closes #1283, support set and get color index, theme and tint for sheet tab
This commit renames `TabColor` into `TabColorRGB` (but keeps an alias for backwards compatibility), as well as adds support for more tab color options (Theme, Indexed and Tint).

Signed-off-by: Thomas Charbonnel <github@charbonnel.email>
2022-07-26 12:36:21 +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
Regan Yue 0d4c97c88a
Optimizing line breaks for comments (#1281) 2022-07-17 12:18:25 +08:00
xuri 40ed1d1b81
Fix potential file corrupted when changing cell value or the col/row
- Remove shared formula subsequent cell when setting the cell values
- Support adjust table range when removing and inserting column/row
2022-07-16 12:50:40 +08:00
MJacred 6429588e14
adjust `ErrColumnNumber`, rename `TotalColumns` to `MaxColumns` and add new constant `MinColumns` (#1272)
Signed-off-by: Benjamin Lösch <loesch.benny92@gmx.de>
2022-07-14 23:36:43 +08:00
xuri e37724c22b
This fix potential panic and file corrupted
- Fix the panic when set or get sheet view options on the sheet without views options
- Fix generated workbook corruption caused by empty created or modified dcterms in the document core properties
- Update the unit tests
2022-07-14 00:17:51 +08:00
xuri a65c5846e4
This closes #1262, support for dependence formulas calculation
- Add export option `MaxCalcIterations` for specifies the maximum iterations for iterative calculation
- Update unit test for the database formula functions
2022-07-10 18:14:48 +08:00
Eagle Xiang 1dbed64f10
This closes #1269, made the `NewStreamWriter` function case insensitive to worksheet name
Co-authored-by: xiangyz <xiangyz@dustess.com>
2022-07-06 20:39:10 +08:00
xuri d74adcbb15
ref #65, new formula function: DGET 2022-07-03 15:31:24 +08:00
xuri 695db4eae0
ref #65, new formula functions: DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, and DVARP 2022-07-02 13:43:31 +08:00
yeshu a77d38f040
Fix CONTRIBUTING doc typo issues (#1266) 2022-07-02 00:38:24 +08:00
yeshu 18afc88759
This closes #1264, fix can't modify cell content issue in some cases
Remove inline rich text when setting cell value and cell formulas
2022-07-01 00:46:23 +08:00
xuri dd6c3905e0
ref #65, new formula function: DAVERAGE 2022-07-01 00:43:27 +08:00
xuri eee6607e47
ref #65, new formula functions: DMAX and DMIN 2022-06-28 23:18:48 +08:00
xuri 301f7bc217
This closes #1260, fixes compiling issue under 32-bit, and new formula functions
- ref #65, new formula functions: DCOUNT and DCOUNTA
- support percentile symbol in condition criteria expression
- this update dependencies module
2022-06-27 21:00:59 +08:00