This release introduces significant new functionality as set out below.
There are almost no changes in existing functional APIs in v0.11.0 compared with v0.10.4. Those changes that have been made are described briefly here.
This version drops support for Julia v1.6, and requires at least Julia v1.8.
Breaking changes
There is only one breaking change in this version:
infer_eltypesnow defaults totrue(e.g. ingettableandreadtable). This is the more common use case but, if it is not your use case, you will need explicitly to setinfer_eltypes = falsein the relevant functions.
All other changes either introduce new functionality (documented elsewhere) or relate to internals only.
New Functions
A number of new functions have been added compared with v0.10.4.
These include 18 new functions to support formatting of cells and cell values together with functions to copy or delete a sheet, to merge cells and to add new defined names for cells or cell ranges. In addition, it is now also possible to assign AnnotatedStrings (from StyledStrings.jl) to cells to create content using Excel’s rich text formatting.
A new function, XLSXFile, is provided that takes a Tables.jl compatible table and creates a new XLSXFile object for writing and which can act as a sink for functions such as CSV.read.
A new function, renamesheet! is created to replace rename! for consistency in naming with addsheet!, copysheet! and deletesheet! and to avoid potential name conflicts when exported (e.g. with DataFrames.rename!). However, the existing function XLSX.rename! is retained (but not exported) to avoid a breaking change.
Two new functions, gettransposedtable and readtransposedtable, mirror gettable and readtable for worksheet tables that have data organised in rows rather than columns.
Some additional convenience functions have also been added to streamline functions that were already available (such as newxlsx, savexlsx).
A wide range of additional indexing options is now widely supported by most functions. Most functions now support indexing rows and columns using vectors, ranges and step ranges and will accept a colon.
Exported Functions
Most useful functions are now public, and can be used without the XLSX. prefix. The following function names are now exported:
-
Files and worksheets
XLSXFile,readxlsx,openxlsx,opentemplate,newxlsx,writexlsx,savexlsx,
Worksheet,sheetnames,sheetcount,hassheet,
addsheet!,renamesheet!,copysheet!,deletesheet! -
Cells & data
CellRef,row_number,column_number,eachtablerow,
readdata,getdata,gettable,readtable,readto,
gettransposedtable,readtransposedtable,
writetable,writetable!,
setFormula,
addDefinedName -
Formats
setFormat,setFont,setBorder,setFill,setAlignment,
setUniformFormat,setUniformFont,setUniformBorder,setUniformFill,setUniformAlignment,setUniformStyle,
setConditionalFormat,
RichTextString,RichTextRun,
setColumnWidth,setRowHeight,
getMergedCells,isMergedCell,getMergedBaseCell,mergeCells
The iterator XLSX.eachrow has retained the XLSX prefix to avoid making a breaking change. However, Base.eachrow now refers to XLSX.eachrow for XLSX.Worksheet data types, meaning that eachrow can be used without qualification, too.
Fixed issues
This release addresses the following issues:
Full list
- https://github.com/JuliaData/XLSX.jl/issues/52
- Writing Excel files is very slow · Issue #61 · JuliaData/XLSX.jl · GitHub
- Feature request: creating & applying cell styles and conditional formatting · Issue #63 · JuliaData/XLSX.jl · GitHub
- Add a way to delete an existing sheet from an Excel file · Issue #80 · JuliaData/XLSX.jl · GitHub
- indexing Rows with vectors · Issue #88 · JuliaData/XLSX.jl · GitHub
- examples of using cell.formula · Issue #120 · JuliaData/XLSX.jl · GitHub
- Iteration interface enhancement for the row iterator · Issue #147 · JuliaData/XLSX.jl · GitHub
- Defining named ranges · Issue #148 · JuliaData/XLSX.jl · GitHub
- How to get a single row just by a row number? · Issue #150 · JuliaData/XLSX.jl · GitHub
- Defaults / interface for XLSX.readtable · Issue #155 · JuliaData/XLSX.jl · GitHub
- writetable with multiple sheets generates .xlsx file with only one sheet visible to applications with less robust .xlsx readers · Issue #156 · JuliaData/XLSX.jl · GitHub
- Some formulas get overwritten with values when editing existing workbook · Issue #159 · JuliaData/XLSX.jl · GitHub
- Extracting hyperlinks from cells? · Issue #165 · JuliaData/XLSX.jl · GitHub
- Unexpected Content Type · Issue #172 · JuliaData/XLSX.jl · GitHub
- Putting NaN in a cell causes Excel to see an error, but it can recover it. · Issue #179 · JuliaData/XLSX.jl · GitHub
- 1 Combine/merge cells. 2 formating table boundaries · Issue #184 · JuliaData/XLSX.jl · GitHub
- Named range being parsed with erroneous single quotes · Issue #189 · JuliaData/XLSX.jl · GitHub
- Asserts should not be used for validation · Issue #190 · JuliaData/XLSX.jl · GitHub
- Recommended way to clear an area in an existing Excel sheet · Issue #198 · JuliaData/XLSX.jl · GitHub
- Sheet is incorrectly shown as 1x1 · Issue #222 · JuliaData/XLSX.jl · GitHub
- c.formula, get full formula text for external links · Issue #224 · JuliaData/XLSX.jl · GitHub
- Simplified way to set cell formulas · Issue #232 · JuliaData/XLSX.jl · GitHub
- Applying number format to columns · Issue #234 · JuliaData/XLSX.jl · GitHub
- Shared formulas not supported · Issue #235 · JuliaData/XLSX.jl · GitHub
- [Bug] Error showing value of type XLSX.XLSXFile, which contains unicode column name · Issue #238 · JuliaData/XLSX.jl · GitHub
- Can supported types (for writing to Excel) be expanded - similar to CSV.write ? · Issue #239 · JuliaData/XLSX.jl · GitHub
- Handling of the merged cells · Issue #241 · JuliaData/XLSX.jl · GitHub
- Cannot open file (failed to parse internal XML file) · Issue #243 · JuliaData/XLSX.jl · GitHub
- Password protected xlsx files · Issue #251 · JuliaData/XLSX.jl · GitHub
- Manually invoking the GC leads to very bad performance if you read many files · Issue #252 · JuliaData/XLSX.jl · GitHub
- Failed to parse internal XML file `xl/comments95.xml` · Issue #253 · JuliaData/XLSX.jl · GitHub
- Cell References unexpected behaviour · Issue #258 · JuliaData/XLSX.jl · GitHub
- XLSX cell format · Issue #259 · JuliaData/XLSX.jl · GitHub
- Offer `normalizenames`? · Issue #260 · JuliaData/XLSX.jl · GitHub
- addsheet! does not append "/xl/worksheets/sheet*.xml" info to [Content_Types].xml · Issue #275 · JuliaData/XLSX.jl · GitHub
- getindex with vector of integer indexes · Issue #276 · JuliaData/XLSX.jl · GitHub
- Add PrecompileTools · Issue #277 · JuliaData/XLSX.jl · GitHub
- gettable does not work? · Issue #278 · JuliaData/XLSX.jl · GitHub
- Writing to a cell in a template overwrites existing formats · Issue #281 · JuliaData/XLSX.jl · GitHub
- Illegal characters can corrupt exported xlsx file · Issue #284 · JuliaData/XLSX.jl · GitHub
- XML.simple_value is only defined for simple nodes · Issue #299 · JuliaData/XLSX.jl · GitHub
- Corruption of < and > in formula · Issue #301 · JuliaData/XLSX.jl · GitHub
- Broken link to ECMA Standard 376 on readme and docs · Issue #305 · JuliaData/XLSX.jl · GitHub
- Cannot create a cell value with leading whitespace · Issue #308 · JuliaData/XLSX.jl · GitHub
- Lazy Parsing Feature? · Issue #311 · JuliaData/XLSX.jl · GitHub
- Date vs DateTime when the time is 0:00:00 · Issue #314 · JuliaData/XLSX.jl · GitHub
- possible release notes for v0.11.0 · Issue #316 · JuliaData/XLSX.jl · GitHub
- Cannot round-trip dynamic array functions · Issue #324 · JuliaData/XLSX.jl · GitHub
- == for SheetCellRef is broken · Issue #331 · JuliaData/XLSX.jl · GitHub
- Request: Make a new release · Issue #335 · JuliaData/XLSX.jl · GitHub
- https://github.com/JuliaData/XLSX.jl/issues/338
- https://github.com/JuliaData/XLSX.jl/issues/342
[Where have the Issue titles gone? They show in preview. They’re back!]
Documentation
The documentation for this package has been extended substantially to cover the new functionality and all changes are (should be) reflected therein. In particular, a detailed guide to using the new formatting functions has been added.
Internal changes
A number of changes to package internals have been made. Specifically, changes have been made to the following data structs:
SheetRowStreamIteratorStateWorksheetCacheIteratorStateWorksheetCacheXLSXFileWorkbookWorksheetSheetRowCell
In particular, the internal memory configuration of an XLSXFile object and its components has been changed significantly, nearly halving the package’s memory footprint.
Changed dependencies
v0.11.0 has now fully migrated to ZipArchives.jl whereas v0.10.4 relied upon both this and ZipFiles.jl. In addition, xml support is now from XML.jl rather than EzXML.jl.
The use of AnnotatedStrings is supported through a package extension. This requires StyledStrings.jl to be in the active environment.
New functionality that has been added has brought the following additional dependencies compared with v0.10.4:
Colors.jlUUIDs.jlRandom.jl
In addition, the test suite now has dependencies on CSV.jl, Distributions.jl and StyledStrings.jl.
Precompilation
v0.11.0 now makes use of PrecompileTools.jl (initially only in a small way).