Skip to content

Commit cd5f236

Browse files
authored
Support comprehensive cell formatting (#285)
* Remove remaining dependency on ZipFile.jl * Remove overlooked use of ZipFile * No need to close zip io any longer * No need to close zip io any longer * Now also removed dependency on EzXML.jl except for calls to the overloaded findall() and findfirst() functions and a single call to EzXMLunlnk(). * Replace EzXML.findall() with a new find_all_nodes() function that uses the XML.jl API. * Replaced EzXML.findfirst() with find_all_nodes()[begin] * Further changes to unlink rows in write.jl * Yesterday's changes * Finally got SheetRowStreamIterator to work! * Further changes bug fixing failed tests * Force recompile? * Now passing all tests except `escape` * Clean up remaining open and close actions * Final fixes to escape tests * Remove unnecesaary data files * Tidy-up * Don't pretty print * Remove last pretty printing example * Simplify regex that undoes pretty printing * Updated to address #281. This now works for text, numbers, dates, times and bools. Also updated to address an issue with escaping in XML.jl (issue 31 in XML.jl - JuliaComputing/XML.jl#31) Also addresses a minor bug not previously identified in tests. * Routing abstract numbers to new code to update cell value only. * Small tidy-up * Add two new functions to make it easier to work with cell formats: - `setFont` to set the font of a cell - `getFont` to retrieve the font of a cell * Drop the `scheme` attribut to encourage font names to work. * Add some tests for setFont(). * Implement `setFont()` over cell ranges and column ranges * Small changes to docstrings and comments. * Add `getBorders()` and `setBorders()` to get and set cell borders (untested). * Now with some tests for `getBorders` and `setBorders` * A few more tests... * Added `setUniformBorder()` and relevant tests. * Added setFill and setUniformFill functions * Added getAlignment and setAlignment functions (not quite working yet!) * SetAlignment function now working with tests * Added a setOutsideBorder function (n tests yet). * Added a setFormat function (no tests yet) * Added a few more tests. * Add `setColumnWidth` function * Add fix for issue #275 * Add `setRowHeight()` function. * Removed stray file * Add a few changes for consistency * Add yet more tests! * Add (unimplemented) function to remove rare illegal characters. * Properly unimplement the illegal characters function! * Adjust docstring formatting. * Fix filename typo * Add formatting functions to API Reference * Bump Julia compat to 1.7 * Update ci.yml to take out Julia 1.6 * Try removing generic function definitions * Changed `@Ref` to `@ref` in `cellformats.jl` * Update cellformats.jl - correct last `@Ref`
1 parent 577b341 commit cd5f236

17 files changed

+3232
-630
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
version:
18-
- '1.6'
1918
- '1.7'
2019
- '1.8'
2120
- '1.9'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ZipArchives = "49080126-0e18-4c2a-b176-c102e4b3760c"
1717
Tables = "1"
1818
XML = "0.3.4"
1919
ZipArchives = "2"
20-
julia = "1.6"
20+
julia = "1.7"
2121

2222
[extras]
2323
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

data/Borders.xlsx

9.27 KB
Binary file not shown.

data/customXml.xlsx

445 Bytes
Binary file not shown.

data/general.xlsx

1.03 KB
Binary file not shown.

docs/src/api.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,18 @@ XLSX.writetable
2424
XLSX.writetable!
2525
XLSX.rename!
2626
XLSX.addsheet!
27+
XLSX.setFormat
28+
XLSX.setUniformFormat
29+
XLSX.setFont
30+
XLSX.setUniformFont
31+
XLSX.setBorder
32+
XLSX.setUniformBorder
33+
XLSX.setOutsideBorder
34+
XLSX.setFill
35+
XLSX.setUniformFill
36+
XLSX.setAlignment
37+
XLSX.setUniformAlignment
38+
XLSX.setUniformStyle
39+
XLSX.setColumnWidth
40+
XLSX.setRowHeight
2741
```

src/XLSX.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include("workbook.jl")
2626
include("worksheet.jl")
2727
include("cell.jl")
2828
include("styles.jl")
29+
include("cellformats.jl")
2930
include("write.jl")
3031

3132
end # module XLSX

0 commit comments

Comments
 (0)