Commit Graph

1052 Commits

Author SHA1 Message Date
张涛 f707b2d2da
This closes #1484, fix the formula calc result issue (#1485)
- Optimize variable name for data validation
2023-03-01 13:25:17 +08:00
xuri 65a53b3ec6
Breaking changes: replace the type `ShapeParagraph` with `RichTextRun`
- This removes the `Color` field from the type `Shape`, and uses the `Fill` instead of it
- Remove sharp symbol from hex RGB color
- Update unit tests
2023-02-27 00:05:36 +08:00
Baris Mar Aziz 669c432ca1
This fixes #756, made stream writer skip set cell value when got nil (#1481) 2023-02-24 00:18:10 +08:00
xuri 94e86dca31
This renamed conditional format type `iconSet` to `icon_set`
- Remove Minimum, Maximum, MinLength, and MaxLength fields from the type `ConditionalFormatOptions`
- Update unit tests and format code
2023-02-22 22:46:36 +08:00
Shugo Kawamura f143dd5c34
Support double-byte chars for formula functions LENB, RIGHTB and MIDB (#1478) 2023-02-21 00:17:35 +08:00
Shugo Kawamura 983cd76485
This closes #1476, support double-byte chars for formula functions LEFT,RIGHT, LEN and MID (#1477) 2023-02-20 13:59:05 +08:00
xuri cb0c1b012b
Support specifies the values in second plot for the bar/pie of pie chart
- Upgrade dependencies package golang.org/x/image to 0.5.0
- Update unit tests
2023-02-19 00:18:11 +08:00
dependabot[bot] 21ec143778
Update dependencies package golang.org/x/net from 0.5.0 to 0.7.0 (#1475) 2023-02-18 14:28:47 +08:00
xuri c2d6707a85
This closes #1474, support set the format for the data series fill (solid fill)
- Breaking changes: remove the `Color` field in the `ChartLine` structure
- This support set the bubble size in a data series
- Unit test update and correct the docs of the function `GetSheetDimension`
2023-02-17 20:03:46 +08:00
jaby ad90cea78b
This closes #1469, fix cell resolver caused incorrect calculation result (#1470) 2023-02-15 21:38:11 +08:00
xuri 363fa940ac
This closes #1468, checks the table name, and added a new error constant `ErrTableNameLength`
- XML Structure field typo fixed
- Update documentation for the `AddChart` function
- Update unit test
2023-02-13 13:28:02 +08:00
Josh Weston 38f131728b
This closes #1463, add new functions `SetSheetDimension` and `GetSheetDimension` (#1467) 2023-02-11 18:37:06 +08:00
xuri 753969dc4e
Support creating a conditional format with an "icon sets" rule
- Improvement compatibility for the worksheet extension lists
- Update unit test
2023-02-08 00:03:45 +08:00
xuri 3e2406096f
This closes #1462 and closes #1464
- Support creating a conditional format with a "stop if true" rule
- Support set border color and create solid color for the color data bar
- Fix incorrect cell type when modifying string cell with the time number
- Update unit test for the add pivot table to avoid pivot table range overlap
2023-02-07 00:08:11 +08:00
xuri 1f69f6b24a
Add support for insert BMP format images
- Add support for workbook function groups
- Update code and docs for the build-in currency number format
- Update unit tests
2023-02-05 01:30:38 +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 85e0b6c56e
Support to create of 17 kinds of fill variants styles
- Update the unit tests
- Update the `SetHeaderFooter` function parameters name
- Update document for the `SetDocProps` and `SetCellHyperLink` functions
2023-02-01 00:11:08 +08:00
Nathan Davies be36b09c8a
This fixes #1457, reduce string concatenation when applying number format (#1459)
Co-authored-by: Nathan Davies <ndavies@turnitin.com>
2023-01-26 10:35:13 +08:00
Nathan Davies 1ab7a99bf0
This fixes #1455, pre generate strings months name for number format (#1456)
- Reducing string concatenation and string conversion between rune string data types

Co-authored-by: Nathan Davies <ndavies@turnitin.com>
2023-01-25 12:22:28 +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 4f0025aab0
This closes #1447, add support for strict theme namespace
- Support specify if applying number format style for the cell calculation result
- Reduce cyclomatic complexities for the OpenReader function
2023-01-13 00:05:46 +08:00
Liron Levin 00c58a73f3
Fix panic caused by the workbook relationship part not exist (#1443)
- Check nil map in the getSheetMap function
- Update unit tests
2023-01-12 00:14:38 +08:00
xuri 14d7acd97e
This fixes #1441, add copyright agreement statement on the LICENSE 2023-01-10 01:02:48 +08:00
xuri 5429f131f8
This closes #1438, fix cell data type issue for formula calculation engine
- Update dependencies module
- Update unit tests
2023-01-08 00:23:53 +08:00
Liron Levin 9c3a5eb983
Add missing error checks in `getSheetMap` to fix panic(#1437)
Unit tests updated
2023-01-07 13:17:00 +08: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
xuri f58dabd492
Breaking change: changed the function signature for 11 exported functions
* Change
    `func (f *File) NewConditionalStyle(style string) (int, error)`
    to
    `func (f *File) NewConditionalStyle(style *Style) (int, error)`
* Change
    `func (f *File) NewStyle(style interface{}) (int, error)`
     to
    `func (f *File) NewStyle(style *Style) (int, error)`
* Change
    `func (f *File) AddChart(sheet, cell, opts string, combo ...string) error`
     to
    `func (f *File) AddChart(sheet, cell string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddChartSheet(sheet, opts string, combo ...string) error`
     to
    `func (f *File) AddChartSheet(sheet string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddShape(sheet, cell, opts string) error`
     to
    `func (f *File) AddShape(sheet, cell string, opts *Shape) error`
* Change
    `func (f *File) AddPictureFromBytes(sheet, cell, opts, name, extension string, file []byte) error`
     to
    `func (f *File) AddPictureFromBytes(sheet, cell, name, extension string, file []byte, opts *PictureOptions) error`
* Change
    `func (f *File) AddTable(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AddTable(sheet, reference string, opts *TableOptions) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) AutoFilter(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AutoFilter(sheet, reference string, opts *AutoFilterOptions) error`
* Change
    `func (f *File) SetPanes(sheet, panes string) error`
     to
    `func (f *File) SetPanes(sheet string, panes *Panes) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) SetConditionalFormat(sheet, reference, opts string) error`
     to
    `func (f *File) SetConditionalFormat(sheet, reference string, opts []ConditionalFormatOptions) error`
* Add exported types:
  * AutoFilterListOptions
  * AutoFilterOptions
  * Chart
  * ChartAxis
  * ChartDimension
  * ChartLegend
  * ChartLine
  * ChartMarker
  * ChartPlotArea
  * ChartSeries
  * ChartTitle
  * ConditionalFormatOptions
  * PaneOptions
  * Panes
  * PictureOptions
  * Shape
  * ShapeColor
  * ShapeLine
  * ShapeParagraph
  * TableOptions
* This added support for set sheet visible as very hidden
* Return error when missing required parameters for set defined name
* Update unit test and comments
2022-12-30 00:50:08 +08:00
Liron Levin a57203a03a
This closes #1432, fix panic formattedValue when style is negative (#1433) 2022-12-29 00:37:37 +08:00
Gin 0c76766c2b
Add support for workbook protection (#1431) 2022-12-27 00:06:18 +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
Bayzet Tlyupov ce4f7a25c9
This closes #1416, support set row outline level to stream (#1422)
Co-authored-by: TlyupovBM <bajjzet.tlyupov@vseinstrumenti.ru>
2022-12-19 09:28:43 +08:00
nesstord 61fda0b1ca
Fix binary string regex (#1415) 2022-12-07 00:45:27 +08:00
jianxinhou 5e0953d778
This closes #1405, add new function SetSheetBackgroundFromBytes (#1406)
Co-authored-by: houjianxin.rupert <houjianxin.rupert@bytedance.com>
2022-12-01 10:44:28 +08:00
xuri c0713951c8
This closes #1404, fixes the insert picture problem in some cases
- Updates unit tests
- Updates documentation for stream mode functions
- Updates hyperlinks in the documentation
2022-11-29 00:03:49 +08:00
devloppper dde6b9c001
This closes #1396, fix formula fn ADDRESS result error with empty worksheet name (#1397)
- Update unit tests

Co-authored-by: jayhoo <hujie@ynningneng.com>
2022-11-22 00:15:57 +08:00
renxiaotu aa80fa4179
This made stream writer support set the insert page break (#1393) 2022-11-16 00:02:35 +08:00
xuri 45d168c79d
This closes #1391, escape XML characters to avoid with corrupt file
- Update and improve unit test coverage
2022-11-15 22:08:37 +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 58b5dae5eb
Support update column style when inserting or deleting columns
- Go Modules dependencies upgrade
- Unify internal variable name
- Unit test updated
2022-11-11 01:50:07 +08:00
March 8753950d62
Delete shared formula in calc chain when writing a formula cell (#1387) 2022-11-08 00:35:19 +08:00
Martin Martinez Rivera 75c912ca95
This closes #1384, fix segmentation fault in `formattedValue` (#1385)
- Add nil pointer guard in cell format
- Add tests to verify the nil checks in formattedValue

Co-authored-by: Zach Clark <zachmclark@gmail.com>
2022-11-05 12:41:07 +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 db2d084ada
This closes #1204, breaking changes for add comments
- Allowing insert SVG format images
- Unit tests updated
2022-11-02 08:45:06 +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 adf9d37d82
This closes #1379, cleanup stream writer temporary files by the `Close` function
- Fix error on inserting columns or rows on the worksheet which contains one cell merged cell range
- Fix getting incomplete rich text cell value in some cases
- Unit tests updated
2022-10-26 00:04:23 +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
gonghaibinx f843a9ea56
Fix the formula calculation result issue of the OR function (#1374)
Co-authored-by: gonghaibin <gonghaibin@qq.com>
2022-10-21 00:04:32 +08:00
xuri 2df615fa28
This close #1373, fixes the incorrect build-in number format apply the result
- An error will be returned when setting the stream row without ascending row numbers, to avoid potential mistakes as mentioned in #1139
- Updated unit tests
2022-10-20 00:02:30 +08:00