Coming from XLSX.jl
OpenDocumentSpreadsheets follows XLSX.jl's interface, so most code needs only its file names changed:
| XLSX.jl | OpenDocumentSpreadsheets |
|---|---|
XLSX.readxlsx, XLSX.openxlsx | readods, openods |
XLSX.newxlsx, XLSX.writexlsx, XLSX.savexlsx | newods, writeods, saveods |
XLSX.streamxlsx | streamods |
XLSXFile, XLSXError | ODSFile, ODSError |
In these docs an open file is called ods, where XLSX.jl's docs call it xf.
These work as in XLSX.jl: readtable, gettable, eachtablerow, readdata, getdata, indexing, getcell, getcellrange, eachrow, iserror, geterror, setdata!, writetable, writetable!, addsheet!, writerow!, writerows! and the Tables.jl interface.
The formatting functions work as in XLSX.jl too, with the differences listed below:
setFont,setFill,setBorder,setAlignment,setFormatand their getters- the
setUniform*variants, andsetBorder'soutside getTextmergeCellsand the other merge functionssetColumnWidth,setRowHeight, their getters andautofitColumnswritetable'scolumn_widthsandcolumn_formats
Renamed functions
Every removal is named delete… here. XLSX.jl's names still work, as other names for the same functions, but they aren't exported: call them as OpenDocumentSpreadsheets.removeAutoFilter, or bring them in with using OpenDocumentSpreadsheets: removeAutoFilter.
| XLSX.jl | OpenDocumentSpreadsheets |
|---|---|
removeAutoFilter | deleteAutoFilter |
removeHeaderFooter | deleteHeaderFooter |
removeMergedCells | deleteMergedCells |
removePanes | deletePanes |
removePrintArea | deletePrintArea |
removePrintTitles | deletePrintTitles |
removeTabColor | deleteTabColor |
removetotals! | deletetotals! |
clearConditionalFormats | deleteConditionalFormats |
OpenDocumentSpreadsheets.removeAutoFilter — Function
removeAutoFilter(sheet)Another name for deleteAutoFilter: the same function.
OpenDocumentSpreadsheets.removeHeaderFooter — Function
removeHeaderFooter(sheet)Another name for deleteHeaderFooter: the same function.
OpenDocumentSpreadsheets.removeMergedCells — Function
removeMergedCells(sheet, ref)Another name for deleteMergedCells: the same function.
OpenDocumentSpreadsheets.removePanes — Function
removePanes(sheet)Another name for deletePanes: the same function.
OpenDocumentSpreadsheets.removePrintArea — Function
removePrintArea(sheet)Another name for deletePrintArea: the same function.
OpenDocumentSpreadsheets.removePrintTitles — Function
removePrintTitles(sheet)Another name for deletePrintTitles: the same function.
OpenDocumentSpreadsheets.removeTabColor — Function
removeTabColor(sheet)Another name for deleteTabColor: the same function.
OpenDocumentSpreadsheets.removetotals! — Function
removetotals!(sheet, name) / removetotals!(table)Another name for deletetotals!: the same function.
OpenDocumentSpreadsheets.clearConditionalFormats — Function
clearConditionalFormats(sheet, ref)Another name for deleteConditionalFormats: the same function.
Differences
- References print in LibreOffice's notation (
Sheet1.A1); Excel's (Sheet1!A1) is still accepted. Lists of areas can also use~. - Formulas read and write in LibreOffice's notation (
=SUM(Sheet2.A1:B2,1)), not Excel's. - Array formulas are LibreOffice's, which fill a fixed range and don't spill:
setFormula(sh, "E1:E3"; val = "=UNIQUE(A1:A9)", array = true)writes one over the range its results fill. XLSX.jl'sspillis an error.getFormulashows the formula in braces on every cell of its range, as LibreOffice's formula bar does, andgetArrayFormulaslists the ranges. - Durations: a time cell of 24 hours or more, or a negative one, reads as a
Dates.CompoundPeriod, not aTime. - Cells: a
Cellholds its decoded value, its value type as a symbol, its style's name and its formula text, rather than XLSX.jl's internal indices. - Error codes are the text LibreOffice shows, including its own
Err:NNN. - Saving an edited file keeps everything not edited, rather than rewriting the file.
display_text=false(no XLSX.jl counterpart) writes smaller files; see Saving and large files.- Formatting works on ODF's styles:
- Styles, not tables. ODF has no font, fill or border tables: a cell has a style, derived from its current one (named styles stay its parent). Setters return the new style's name for a single cell, and getters report what the cell's style resolves to, also on read-only files.
- Empty cells are formatted, as in LibreOffice, and whole columns and rows are formatted to the end of the sheet, not only up to the used area.
- What ODF can't hold: superscript and subscript (
vertAlign) are refused in cell formats (use rich text); pattern fills are blended into one colour, as LibreOffice does when it opens an xlsx file. - Number formats are ODF data styles, in the form LibreOffice writes for the same code, and
getTextshows a value as LibreOffice shows it, which differs from Excel in places (General shows up to 15 significant digits, for example). - Column widths in characters are the widths LibreOffice gives an XLSX.jl file's, so a width looks the same in both;
getColumnWidthreports them as XLSX.jl does. - Merged cells are an anchor cell and covered cells, as LibreOffice writes them.
- Named cell styles (
setCellStyle,addCellStyle) are LibreOffice's, which XLSX.jl lacks.
- Inserting and deleting rows and columns (
insertRows,insertColumns,deleteRows,deleteColumns) take XLSX.jl's arguments and behave as LibreOffice does: a deleted reference is stored as#REF!without its sheet, 3-D references follow, new rows copy the formatting of the row above (borders included), and new columns that of the column to their left, with the width of the column they push right. - Sheet operations (
renamesheet!,deletesheet!,copysheet!,movesheet!) take XLSX.jl's arguments and behave as LibreOffice does; a copy repoints only references whose sheet name is relative, and a name already in use is an error. - Defined names (
addDefinedName,deleteDefinedName,deleteAllDefinedNames,getDefinedNames,getAllDefinedNames) take XLSX.jl's arguments, with LibreOffice's rules: a name may hold?but not\, and names such asC1xthat LibreOffice reads as references are refused. A sheet's name may refer to another sheet, whole columns and rows can be named, andBoolconstants stayBool. A formula's sheet names without$are relative, as in LibreOffice. ODF has no system names, soforceandinclude_systemchange nothing. - Hiding (
setRowHidden,setColumnHidden,setSheetVisibility) and tab colours (setTabColor) take XLSX.jl's arguments. ODF has no very hidden sheets::veryHiddenhides a sheet as:hiddendoes, as LibreOffice imports Excel's. Theme colours are not accepted, as elsewhere in OpenDocumentSpreadsheets. - Grouping (
groupRows,groupColumns,ungroupRows,ungroupColumns) takes XLSX.jl's arguments, but follows LibreOffice, whose groups are nested containers rather than Excel's levels per line: groups next to each other stay separate, ungrouping removes a whole group (and lifts the groups inside it), and a range that crosses a group, or an eighth level, is an error. - Panes and the sheet view (
freezePanes,splitPanes,setSheetView,getSheetView) take XLSX.jl's arguments and are kept as LibreOffice keeps them, in its view settings: the page-break view, row and column headers and zeros are the whole file's; a selection is kept as its cursor only; zoom runs from 20 to 600; LibreOffice has no page layout view and no "frozen split" (splitFreezefreezes). A split's position is in screen pixels, so it falls at the edge of the rows and columns given on a 96-dpi screen at 100% zoom. - Protection (
protectSheet,protectWorkbook,setCellProtectionand their getters) takes XLSX.jl's arguments, stored as LibreOffice stores it. Passwords are hashed as LibreOffice hashes them (SHA-1 of the UTF-16 text), so any text works, not only 15 ASCII characters. LibreOffice has no permission to format, sort, insert hyperlinks or edit objects and scenarios on a protected sheet, and no window protection: asking for them is an error. - Printing (
setPageSetup,setPageMargins,setPrintOptions,setPrintArea,setPrintTitles,setHeaderFooterand their getters) takes XLSX.jl's arguments, Excel's header codes included, and stores everything as LibreOffice's xlsx import stores it: a page style of the sheet's own (PageStyle_<sheet>), ODF fields and text styles for the codes,table:print-rangesand header-row containers.paperSizes are those the import knows (Excel's 1, 3, 4, 5, 7, 8, 9, 11, 12, 13 and 70), and any other size ispaperWidthandpaperHeight; headers can't be told not to scale or align with the margins (scaleWithDoc,alignWithMargins), as in LibreOffice. A sheet without a page style of its own prints LibreOffice's default header and footer, andgetHeaderFootersays so. - Document properties (
setDocumentProperties,setCustomPropertyand their getters) take XLSX.jl's arguments, stored in meta.xml as LibreOffice's xlsx import stores them. ODF has no category, content status, company or manager: they are the custom properties the import makes of them (OOXMLCorePropertyCategory,OOXMLCorePropertyContentStatus,Company,Manager), whichgetCustomPropertiesleaves out. Custom numbers are ODF's floats (a whole one is read back as anInt64), and custom properties are kept in name order, as LibreOffice keeps them.getCustomPropertiesgives aVectorof pairs, not anOrderedDict. - Hyperlinks (
addHyperlinkand the rest) take XLSX.jl's arguments. A text cell gets a link round its text and a number or formula a link of the cell itself, as LibreOffice's import gives XLSX.jl's links. LibreOffice has no tooltips, sotooltipis an error. - Notes (
addComment) are LibreOffice's comments. Threaded comments are kept as LibreOffice keeps Excel's: inside a note, which shows the thread's text where threads aren't supported. - Pictures (
addImage) are anchored in their first cell and resize with their cells, as LibreOffice's import places XLSX.jl's. LibreOffice has no pictures inside cells, soinCell=trueis an error. - Data validation (
addDataValidation) is LibreOffice's Data ▸ Validity, stored as its import stores XLSX.jl's. A cell has one rule. - Tables (
addtable!,settotals!,appendtable!,table,readtable(…; table_name),writetable(…; as_table)and the rest) are LibreOffice's database ranges. LibreOffice has no table styles (styleis an error) and keeps no totals settings: a totals cell's setting is read from its formula, written as LibreOffice saves a structured reference (SUBTOTAL(109,$Sheet.$B$2:$B$5)). As in LibreOffice, a table's name is formed as a defined name's but is apart from them, tables may overlap, and a table may be its header alone. - AutoFilters (
setAutoFilter,getAutoFilter,deleteAutoFilter) take XLSX.jl's arguments and criteria, stored in the sheet's anonymous database range as LibreOffice stores them. Rows are hidden as LibreOffice's Refresh Range hides them, not as Excel does: text LibreOffice reads as a number ("10","2026-11-23") is compared with numbers by value, list items are compared as text (a date matches only at midnight), and rankings count text and errors. LibreOffice can't store above- or below-average or relative-date filters, so they are errors.deleteAutoFiltershows every row of the range, as LibreOffice does.sortputs the rows in LibreOffice's order (numbers and logicals, text, errors; blanks last), and moves formats, validations, notes, links, pictures and hidden rows with them; formulas move as copied and are saved without a value. Merged cells (with formats) and array formulas are refused. - LibreOffice's own options are keywords and fields of the XLSX.jl functions they belong with: a validation's
caseSensitiveandsortEntries, cell protection'shideAllandhidePrint, a note'sdate, a picture'saltanddescription, any paper size (paperWidth,paperHeight),scaleToPages, six more print options, a table'shas_header_rowandfilterButtons, a filter'scaseSensitive,noDuplicatesand regular expressions, and a sort'snaturalSortandincludeFormats. - Rich text (
RichTextString,RichTextRun,getRichTextString) is LibreOffice's: a run is a span whose text style holds only the run's attributes, so a run takes the attributes it doesn't set from the cell, as in LibreOffice. In Excel those come from the default font. Colours are stored as RGB, and a line break starts a new paragraph. Chart titles take rich text too. - Conditional formats (
setConditionalFormat,getConditionalFormats,deleteConditionalFormats,setColoredDataBars) take XLSX.jl's types, keywords and presets, and are stored as LibreOffice's rules:- Formats: each rule's format is a named cell style (
ConditionalStyle_N), as LibreOffice's import makes them;styleapplies any named style instead. - Order: rules on one range are applied in the order they were set, the first that holds winning.
- Errors: what LibreOffice doesn't support (
stopIfTrue, standard deviations, data bar borders, right-to-left bars, custom and reversed icon sets). - Fixed:
greaterEqualandlessEqualwork; XLSX.jl's own files lose them in LibreOffice. - LibreOffice's own options: this, last and next year, its smiley icon sets, and a bar's
minLengthandmaxLength.
- Formats: each rule's format is a named cell style (
- Charts (
XLSX.Charts's functions, inOpenDocumentSpreadsheets.Charts) are LibreOffice's chart objects. See Charts.- Look: new charts take LibreOffice's own.
- Data: values are read from their cells.
- References: a chart's references follow edits and sheet operations as LibreOffice moves them (clipped, never
#REF!; a copy's stay on the source). - LibreOffice's model: categories are the x axis'; smoothing is the chart's; a line series has one colour; theme colours are resolved against the document's theme; legend corners are custom positions; a minor unit divides the major one.
- Errors: what LibreOffice can't store (titles from cells, compound lines, joins, marker borders, bubble-size labels, text caps, kerning and outlines; the chartex kinds but the histogram).
- Histograms:
addChartEx(ws, :histogram, values; …)works, and makes the same chart asaddChart(ws, :histogram; …)followed byaddSeries, the form the guide uses. A histogram is an ordinary chart in an OpenDocument file; its handle is still aChartEx, with XLSX.jl's histogram functions, andgetChartSchemagives:cx. - Chart sheets are ordinary sheets holding a page-anchored chart.
- LibreOffice's own options: 3-D, stock charts, subtitles, data tables, stepped and B-spline lines, empty and hidden cells, the chart wizard's
data, gradients and hatches, trendlines and error bars, explosion, and axis label arrangement.
- Sparklines (
addSparklines,getSparklines,deleteSparklines) are LibreOffice's sparkline groups.dateRangeis an error, since LibreOffice keeps none. A sparkline goes with its cell through inserts and deletes, and its data moves as a chart's does.