Commit Graph

202 Commits

Author SHA1 Message Date
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 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
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 504d469d3d
This closes #1298, fix doc properties missing after creating new worksheet 2022-08-03 00:42:16 +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 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
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 852f211970
This closes #1257, fix incorrect worksheet header footer fields order 2022-06-21 20:08:47 +08:00
Eng Zer Jun 6bcf5e4ede
refactor: replace strings.Replace with strings.ReplaceAll (#1250)
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>
2022-06-12 00:19:12 +08:00
xuri 1c167b96a3
Improves the calculation engine, docs update, and adds the dependabot
- Initialize array formula support for the formula calculation engine
- Update example and unit test of `AddPivotTable`
- Update the supported hash algorithm of ProtectSheet
2022-05-26 00:15:28 +08:00
xuri afb2d27c90
This fix formula calculation accuracy issue and panic when set pane
- Fix `GROWTH` and `TREND` calculation accuracy issue
- Fix panic when add pane on empty sheet views worksheet
- New exported constants `MinFontSize`
2022-05-23 13:02:11 +08:00
xuri 0c3fd0223c
This closes #1225, allowing insert EMF format images 2022-05-13 01:03:40 +08:00
xuri 8a335225c7
Format code, update documentation and remove exported variable `XMLHeaderByte` 2022-03-24 00:19:30 +08:00
xuri f0cb29cf66
This closes #1162, improve the compatibility with alternate content
Preserve alternate content in the workbook, worksheet, and drawingML
2022-03-05 14:48:34 +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 b96329cc88
Breaking change for data validation and fixed #1117
- Remove second useless parameter `isCurrentSheet` of the function `SetSqrefDropList`
- Fix missing page setup of worksheet after re-saving the spreadsheet
2022-01-12 00:18:15 +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
Jonham.Chen af5c4d00e8
feat: implement SHA-512 algorithm to ProtectSheet (#1115) 2022-01-08 10:32:13 +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 577a07f08c
Simplify code and update unit test
Improve unit test coverage for the functions: `NewStyle`, `SetActiveSheet`, `SearchSheet` and `deleteAndAdjustDefinedNames`
Simplify code and add comments for the function: `deleteAndAdjustDefinedNames`
2021-12-03 00:19:11 +08:00
Michael Wiesenbauer aa359f1c74
refactor DeleteSheet for better readability (#1078)
Signed-off-by: Michael Wiesenbauer <michael.wiesenbauer@ambos.io>
Co-authored-by: Michael Wiesenbauer <michael.wiesenbauer@fau.de>
2021-12-02 22:14:57 +08:00
xuri 6b277c61d2
Fix sheet deletion fail in some case 2021-11-18 08:06:14 +08:00
xuri bc3c7d51a2
ref #65: new formula function PRICE
- fix COUPPCD result accuracy issue
- update close spreadsheet example in documentation and README
2021-11-17 00:25:36 +08:00
xuri bda8e7f812
This closes #1061, support multi-byte language on set header footer
typo fixed and simplify code for read the data values arguments of formula functions
2021-11-16 00:40:44 +08:00
xuri 57275db22e
This closes #1057, merge column styles to reduce spreadsheet size 2021-11-14 00:17:31 +08:00
Sean Liang 32548a6cac
return immediately when matched for efficiency (#1049) 2021-11-03 15:13:46 +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 48c16de8bf
Improve security and simplify code
- 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
2021-08-15 00:06:40 +08:00
three f6f14f507e
Speed up merge cells 2021-08-13 01:32:44 +08:00
xuri 7dbf88f221
This closes #971, closes #972 and closes #974
- Escape XML character in the drop list
- Fix incorrect character count limit in the drop list
- Fix Excel time parse issue in some case
- Fix custom number format month parse issue in some case
- Fix corrupted file generated caused by concurrency adding pictures
2021-07-29 00:03:57 +08:00
xuri 5ce3fe8cb8
Improvement compatibility with invalid first-page number attribute in the page layout 2021-07-21 23:24:49 +08:00
xuri fbcfdeae90
This closes #879, fix delete defined name failed in some case 2021-07-15 23:24:01 +08:00
xuri b14b74bf56
This closes #873, make the sheet names are not case sensitive for `NewSheet`, `GetSheetIndex`, `DeleteSheet` 2021-07-10 23:47:35 +08:00
xuri 90d200a10b
Make the functions `SetSheetRow`, `New Style` and `SetCellStyle` concurrency safety 2021-07-07 00:57:43 +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
xuri 0e02329bed
This closes #861, support concurrency get cell picture and remove unused internal function `getSheetNameByID` 2021-07-04 12:13:06 +08:00
vettich 5ec61310dc
fix: LocalSheetID in DefinedName should be equal to SheetIndex instead of SheetID (#868) 2021-07-03 14:13:26 +08:00
xuri be12cc27f1
This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message 2021-05-10 00:09:24 +08:00
xuri 0e0237e62d
compatibility with non-standard page setup attributes 2021-05-07 23:08:58 +08:00
xuri 438fd4b3f9
This closes #834, fix invalid file path and duplicate namespace when re-creating worksheet 2021-05-06 22:09:12 +08:00
xuri f8f699a172
Go 1.15 and later required, #65 fn: IMABS, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN and IMLOG10 2021-04-04 15:29:43 +08:00
xuri 2af96c0714
#65 fn: N, PERCENTILE.INC and T
typo fixed
2021-03-30 23:02:22 +08:00
David d08a6d2437
updated SetDefinedName's localSheetId attr to use sheetIndex
Excelize 2.3.2 OUT:

```
<sheets>
        <sheet name="Q-P-QP-11" sheetId="55" r:id="rId1"/>
        <sheet name="Q-P-QP-12" sheetId="53" r:id="rId2"/>
        <sheet name="Q-P-QP-13" sheetId="54" r:id="rId3"/>
        <sheet name="Q-P-RN-12" sheetId="56" r:id="rId4"/>
        <sheet name="Q-P-RN-13" sheetId="57" r:id="rId5"/>
        <sheet name="C-C-QP-11-12-13-RN-12-13" sheetId="50" r:id="rId6"/>
        <sheet name="E-T-QP-11-12-13" sheetId="31" r:id="rId7"/>
        <sheet name="E-T-BK" sheetId="60" r:id="rId8"/>
        <sheet name="E-A-RN-12-13" sheetId="43" r:id="rId9"/>
        <sheet name="F1-A-QP-11-12-13" sheetId="1" r:id="rId10"/>
        <sheet name="F2-A-QP-11-12-13" sheetId="23" r:id="rId11"/>
        <sheet name="C-A-QP-12-13-RN-12-13" sheetId="48" r:id="rId12"/>
        <sheet name="C-T-QP-12-13" sheetId="7" r:id="rId13"/>
        <sheet name="R-T-QP-12-RN-12-13" sheetId="45" r:id="rId14"/>
        <sheet name="C-T-QP-11" sheetId="58" r:id="rId15"/>
        <sheet name="R-T-QP-11" sheetId="3" r:id="rId16"/>
        <sheet name="A-T-QP-11-12-RN-12" sheetId="13" r:id="rId17"/>
        <sheet name="A2-T-RN-13" sheetId="42" r:id="rId18"/>
        <sheet name="ap-T-QP-11" sheetId="59" r:id="rId19"/>
        <sheet name="B-A-QP-12-13" sheetId="32" r:id="rId20"/>
        <sheet name="B-A-QP-11" sheetId="33" r:id="rId21"/>
    </sheets>
    <definedNames>
        <definedName localSheetId="58" name="_xlnm.Print_Titles">ap-T-QP-11!$2:$5</definedName>
        <definedName localSheetId="2" name="_xlnm.Print_Titles">R-T-QP-11!$2:$13</definedName>
    </definedNames>
```

MS Excel 2010 out

```
<sheets>
        <sheet name="Q-P-QP-11" sheetId="55" r:id="rId1"/>
        <sheet name="Q-P-QP-12" sheetId="53" r:id="rId2"/>
        <sheet name="Q-P-QP-13" sheetId="54" r:id="rId3"/>
        <sheet name="Q-P-RN-12" sheetId="56" r:id="rId4"/>
        <sheet name="Q-P-RN-13" sheetId="57" r:id="rId5"/>
        <sheet name="C-C-QP-11-12-13-RN-12-13" sheetId="50" r:id="rId6"/>
        <sheet name="E-T-QP-11-12-13" sheetId="31" r:id="rId7"/>
        <sheet name="E-T-BK" sheetId="60" r:id="rId8"/>
        <sheet name="E-A-RN-12-13" sheetId="43" r:id="rId9"/>
        <sheet name="F1-A-QP-11-12-13" sheetId="1" r:id="rId10"/>
        <sheet name="F2-A-QP-11-12-13" sheetId="23" r:id="rId11"/>
        <sheet name="C-A-QP-12-13-RN-12-13" sheetId="48" r:id="rId12"/>
        <sheet name="C-T-QP-12-13" sheetId="7" r:id="rId13"/>
        <sheet name="R-T-QP-12-RN-12-13" sheetId="45" r:id="rId14"/>
        <sheet name="C-T-QP-11" sheetId="58" r:id="rId15"/>
        <sheet name="R-T-QP-11" sheetId="3" r:id="rId16"/>
        <sheet name="A-T-QP-11-12-RN-12" sheetId="13" r:id="rId17"/>
        <sheet name="A2-T-RN-13" sheetId="42" r:id="rId18"/>
        <sheet name="ap-T-QP-11" sheetId="59" r:id="rId19"/>
        <sheet name="B-A-QP-12-13" sheetId="32" r:id="rId20"/>
        <sheet name="B-A-QP-11" sheetId="33" r:id="rId21"/>
    </sheets>
    <definedNames>
        <definedName name="_xlnm.Print_Titles" localSheetId="18">'ap-T-QP-11'!$2:$5</definedName>
        <definedName name="_xlnm.Print_Titles" localSheetId="15">'R-T-QP-11'!$2:$13</definedName>
    </definedNames>
```


Compare localSheetId it uses sheet index instead of sheet's sheetId
2021-03-21 19:39:36 -04:00
xuri afe2ebc261 This improves compatibility for absolute XML path, Windows-style directory separator and inline namespace; 2021-02-27 08:49:10 +08:00
xuri d84050921e
check empty rich text run properties; new formula fn: LEFT, LEFTB, RIGHT, RIGHTB 2021-02-23 00:05:19 +08:00