92 Commits

Author SHA1 Message Date
Todd
b30eaaae44 format: change debugging log.Fatal to log.Printf 2017-09-18 22:30:08 -05:00
Todd
b03eec358d spreadsheet: add xlsx2csv demo
This demo program will extract either raw or formatted
values from a spreadsheet, creating one CSV file per
sheet.
2017-09-18 22:30:08 -05:00
Todd
49e34b1d90 formula: better support for thousands separator 2017-09-18 22:30:08 -05:00
Todd
d69cf90249 format: implement support for evaluating spreadsheet number formatting
This adds support for extracting a cell's formatted value according to
the number format applied to the cell.  To do this we need to implement
a parser for Excel style format strings and support formatting numbers
according to that style.

This also enhances the General formatting to be much closer to what
Excel normally does. There are likely still a few corner cases where
Excel and gooxml differ, but hopefully not too many.
2017-09-18 22:30:08 -05:00
Todd
d9c4a27794 spreadsheet: start adding support for extracting formatted cell value 2017-09-18 22:30:08 -05:00
Todd
39028bcd7a spreadsheet: add ability to recalculate formulas
If the formula executes without errors, it stores the
result as a cached value in the sheet.
2017-09-17 14:56:58 -05:00
Todd
b54a2efd19 formula: add method to determine the supported functions 2017-09-17 14:56:58 -05:00
Todd
422484af83 formula: add more complex function support
- INDEX
- INDIRECT
- OFFSET
2017-09-17 14:56:58 -05:00
Todd
92c902e6bd formula: support for using named ranges/tables from formulas 2017-09-17 14:56:58 -05:00
Todd
a4a1562f7c spreadsheet: add formula reading/writing support
Minimal support for now, just enough to read table
ranges so they can be used from formulas.
2017-09-17 14:56:58 -05:00
Todd
5ed34695bd formula: add support for text functions
- CHAR
- CLEAN
- CODE
- CONCATENATE
- EXACT
- LEFT
- LEN
- LOWER
- PROPER
- REPT
- RIGHT
- T
- TRIM
- UNICHAR
- UNICODE
- UPPER
2017-09-17 09:23:37 -05:00
Todd
09419b822f formula: trig functions
- ACOT
- ACOTH
- CEILING (legacy version)
- COT
- COTH
- CSC
- CSCH
- FLOOR (legacy version)
- SEC
- SECH
2017-09-16 21:12:41 -05:00
Todd
29e03fc7b7 formula: more math/trig functions
- SIGN
- SIN
- SINH
- SQRT
- SQRTPI
- SUM
- SUMPRODUCT
- SUMSQ
- TAN
- TANH
- TRUNC
2017-09-16 18:13:20 -05:00
Todd
e46a7165b4 formula: more implementations of math/trig functins
- MDETERM
- MOD
- MROUND
- MULTINOMIAL
- MUNIT
- ODD
- POWER
- PRODUCT
- QUOTIENT
- RADIANS
- RAND
- RANDBETWEEN
- ROMAN
- ROUND
- ROUNDDOWN
- ROUNDUP
- SERIESSUM
2017-09-16 16:52:14 -05:00
Todd
23e428e770 formula: return array instead of list for ranges
This will be required for functions that need to know
the structure of the input.
2017-09-16 16:52:14 -05:00
Todd
5a5c16b89a formula: add initial support for cell arrays
This is a pretty uncommon feature from what I can tell
and is not fully supported. The example for the MDETERM
function uses an array though, so this will at least add
enough support for the examples to compute correctly.
2017-09-16 16:52:14 -05:00
Todd
fb43078e87 formula: add support for referencing other sheets
This adds support references like 'Sheet 1'! so that formulas
can pull values from other sheets.
2017-09-16 10:33:13 -05:00
Todd
e0786dae4a formula: support for more math/trig formulas
- EVEN
- EXP
- FACT
- FACTDOUBLE
- FLOOR.MATH
- FLOOR.PRECISE
- GCD
- INT
- ISO.CEILING
- LCM
- LN
- LOG
- LOG10
2017-09-16 09:46:44 -05:00
Todd
199db803a0 spreadsheet: fix bug with column to index 2017-09-15 17:43:40 -05:00
Todd
9b89ae1f12 spreadsheet: add fast paths for appending rows/cells 2017-09-15 17:43:40 -05:00
Todd
382c157c11 formula: add more math formulas
- ABS
- ACOS
- ACOSH
- ARABIC
- ASIN
- ASINH
- ATAN
- ATANH
- ATAN2
- BASE
- CEILING.MATH
- CEILING.PRECISE
- COMBIN
- COMBINA
- COS
- COSH
- DECIMAL
- DEGREES
- PI
2017-09-15 17:43:40 -05:00
Todd
17a365ee93 spreadsheet: start adding support for formula evaluation
We can take advantage of cached formula results that Excel/LibreOffice
insert to ensure that our formula results match the expected results.
2017-09-14 22:17:42 -05:00
Todd
111567b74e spreadsheet: default new cells to numeric with implicit zero value 2017-09-14 22:17:42 -05:00
Todd
1ff1b074f7 spreadsheet: add support for setting the active sheet
This is the tab that is initially selected when opening
a spreadsheet.
2017-09-12 16:32:16 -05:00
Todd
58b6c0700e spreadsheet: allow multiple anchor types for charts 2017-09-11 20:17:06 -05:00
Todd
558e5ee274 spreadsheet: add image support and example 2017-09-11 20:17:06 -05:00
Todd
90e6416440 spreadsheet: add more fine control over anchoring 2017-09-11 20:17:06 -05:00
Todd
0791b4688b spreadsheet: add freeze rows/columns support and example 2017-09-10 19:11:53 -05:00
Todd
9e6bfaf6e1 spreadsheet: add method to clear cached formula results 2017-09-10 17:28:36 -05:00
Todd
f3eca9e68e spreadsheet: add support for data validation rules 2017-09-10 17:13:40 -05:00
Todd
db7145dcbb spreadsheet: add helper function for applying a border to multiple cells 2017-09-10 16:13:11 -05:00
Todd
2312e6cdc8 spreadsheet: add initial cell border example 2017-09-10 16:13:11 -05:00
Todd
3bc4675cf6 spreadsheet: add comment support
This adds comment support for sheets.  Excel requires a VML drawing with
the comment box shape for each comment to display the comment.
LibreOffice displays comments fine with or without the shape, and
creates the shape for its own comments.  For the sake of compatibility,
we create comment shapes as well.

I know of no other use for the legacy VML support other than comment
boxes...
2017-09-10 11:25:29 -05:00
Todd
50c3c2c990 document/spreadsheet: updates for new schema 2017-09-10 10:33:53 -05:00
Todd
3d6b12368b spreadsheet: add complex example
This has some conditional formatting, charts and auto filters.
2017-09-09 11:02:39 -05:00
Todd
ceb8570558 spreadsheet: add support for column formatting 2017-09-09 11:02:39 -05:00
Todd
cdb3f64c4a spreadsheet: more fill cleanup 2017-09-09 11:02:39 -05:00
Todd
3b50df7eb7 spreadsheet: add support for conditional formatting 2017-09-09 09:34:57 -05:00
Todd
9433c08f42 spreadsheet: rework fills
Fills were a little odd before, this modifies them to
work similarly to the other type (user API didn't change).
2017-09-09 09:34:57 -05:00
Todd
d5c07a59d6 spreadsheet: add method to determine sheet extents 2017-09-09 09:34:57 -05:00
Todd
41e2d6eaec document: add support for rewriting document filenames
The problem this solves is loading and re-saving a document
that uses an odd file structure (e.g. the main body is
not at word/document.xml).  I've seen this occur with spreadsheets
but not with a docx in the wild, however it's fairly simple
to handle in case it occurs.
2017-09-08 18:30:40 -04:00
Todd
9b33f72f6e spreadsheet: add spreadsheet golden test 2017-09-08 18:20:52 -04:00
Todd
924140c87d spreadsheet: add support for merged cells 2017-09-07 19:12:30 -04:00
Todd
8957cf73e3 spreadsheet: add validation for sheet name length 2017-09-07 19:12:30 -04:00
Todd
f70810321d spreadsheet: support adding/removing an auto filter 2017-09-07 16:39:40 -04:00
Todd
d8554f54de spreadsheet: fix bug when saving sheets loaded with themes 2017-09-07 12:44:31 -04:00
Todd
2d710a2e6d spreadsheet: ensure rows stay sorted
This fixes an issue with Mac Excel being unable to display
unsorted rows.
2017-09-07 12:44:31 -04:00
Todd
03540b8c38 spreadsheet: add support for defined names 2017-09-07 07:34:52 -04:00
Todd
2498814f67 spreadsheet: add support for hyperlinks 2017-09-07 06:12:41 -04:00
Todd
adb206e663 spreadsheet: always set cell reference numbers 2017-09-07 06:12:41 -04:00