API reference: links, notes and objects
Hyperlinks, notes and threaded comments, pictures, Validity rules, database ranges, AutoFilters and sorting. The guide introduces them: Pictures, Notes and comments, Hyperlinks, Validity, Database ranges and AutoFilter and sorting.
Hyperlinks
LibreOffice's two kinds of link: a URL field in a cell's text, and a cell link in its style:
OpenDocumentSpreadsheets.addHyperlink — Function
addHyperlink(sheet, ref; url=nothing, location=nothing, display=nothing) -> NamedTuple
addHyperlink(sheet, row, col; kw...) -> NamedTupleMake a cell, or each cell of a range ("A1:C3"), a hyperlink: a link round a text cell's text, or a link of the cell itself for a number or formula. Give exactly one of:
url: an address outside the workbook ("https://julialang.org","mailto:team@example.com"), or a file relative to the document's folder ("report.pdf")location: a place in the workbook: a cell or range ("Sheet2.A1"or"Sheet2!A1","'My Sheet'.C3"), a sheet, or a defined name
LibreOffice has two kinds of link. An empty cell, or a text cell, gets a URL field around its text: an empty cell takes display (or url, or location) as its text, and a text cell keeps its text. A number, a formula, and every cell of a range after the first get a cell link: their value is unchanged, and a click on the cell follows it. A cell's previous links are replaced. Writing a new value into a cell drops its URL field, as in LibreOffice; its cell link stays.
A URL is kept as LibreOffice keeps it once loaded: its scheme in lower case, and for http, https and ftp a / after a host with no path and spaces as %20 ("https://julialang.org" becomes "https://julialang.org/"). A relative file is written as the file's format needs it: ../report.pdf in a zipped .ods, whose links are relative to the package, and report.pdf in a flat .fods.
LibreOffice has no tooltips: tooltip is an error.
Returns the link of the first cell, as getHyperlink reads it. The file must be writable.
sh["D1"] = "Julia"
addHyperlink(sh, "D1"; url = "https://julialang.org") # the text becomes the link
addHyperlink(sh, "D2"; location = "Data.A1", display = "To the data")
addHyperlink(sh, "A1"; url = "report.pdf") # a number: the cell linksaddHyperlink(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getHyperlink — Function
getHyperlink(sheet, ref) -> Union{Nothing, NamedTuple}
getHyperlink(sheet, row, col) -> Union{Nothing, NamedTuple}The hyperlink of a cell, as (sheet, ref, url, location, display, tooltip), or nothing: its first URL field, else its cell link. url is set for a link outside the workbook (a file relative to the document's folder as such), location for a place in it, in LibreOffice's notation (Sheet2.A1). display is a URL field's text (nothing for a cell link), and tooltip is always nothing: LibreOffice has none.
getHyperlink(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getHyperlinks — Function
getHyperlinks(sheet) -> Vector{NamedTuple}
getHyperlinks(ods::ODSFile) -> Vector{NamedTuple}Every hyperlink of a sheet, or of every sheet, by row and then column: each URL field of a cell, then its cell link, as getHyperlink gives them.
OpenDocumentSpreadsheets.deleteHyperlink — Function
deleteHyperlink(sheet, ref) -> Bool
deleteHyperlink(sheet, row, col) -> BoolRemove the links of a cell, or of every cell of a range: its URL fields (the text stays) and its cell link. Returns whether there was one. The file must be writable.
deleteHyperlink(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
Notes and threaded comments
LibreOffice's annotations, and the threaded comments it keeps inside them:
OpenDocumentSpreadsheets.addComment — Function
addComment(sheet, ref, text; author="", width=144, height=79, visible=false, date=now) -> NamedTuple
addComment(sheet, row, col, text; kw...) -> NamedTupleAttach a note (LibreOffice's comment, an annotation) to one cell, replacing any it has. text may hold line breaks (\n). author is shown with the note; width and height are its size in pixels (LibreOffice sizes a note's width from its text, and takes the height as a minimum); visible=true shows it always, not only when the mouse is over the cell. A cell with a threaded comment is refused.
date (a Date or DateTime; the time of the call, in UTC, if not given) is the date LibreOffice shows with the note's author.
Returns (sheet, ref, author, text, date). The file must be writable.
addComment(sh, "B2", "Checked against the bank statement"; author = "Sam")
addComment(sh, "A1", "Always shown\non two lines"; visible = true)addComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getComment — Function
getComment(sheet, ref) -> Union{Nothing, NamedTuple}
getComment(sheet, row, col) -> Union{Nothing, NamedTuple}The note of a cell, as (sheet, ref, author, text, date), or nothing. date is LibreOffice's (a DateTime), nothing for a note without one. For a cell with a threaded comment, the note kept with it (the text shown by versions without threads); read the thread with getThreadedComment.
getComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getComments — Function
getComments(sheet) -> Vector{NamedTuple}
getComments(ods::ODSFile) -> Vector{NamedTuple}Every note of a sheet, or of every sheet, as getComment gives them, by row and then column.
OpenDocumentSpreadsheets.deleteComment — Function
deleteComment(sheet, ref) -> Bool
deleteComment(sheet, row, col) -> BoolRemove a cell's note (with its thread, if it has one: in LibreOffice they are one object). Returns whether there was one. The file must be writable.
deleteComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.addThreadedComment — Function
addThreadedComment(sheet, ref, text; author, date=now(UTC)) -> NamedTuple
addThreadedComment(sheet, row, col, text; kw...) -> NamedTupleStart a threaded comment on one cell: a loext:threaded-comment inside the cell's note, whose text is the one shown by versions without threads. author is the name shown (one of the workbook's people, shared by every comment with that name); date is when it was written, in UTC. A cell with a note or a thread is refused: add to a thread with addThreadedReply.
Returns the thread, as getThreadedComment reads it. The file must be writable.
addThreadedComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.addThreadedReply — Function
addThreadedReply(sheet, ref, text; author, date=now(UTC)) -> NamedTuple
addThreadedReply(sheet, row, col, text; kw...) -> NamedTupleAdd a reply to the end of a cell's threaded comment. Returns the thread. The file must be writable.
addThreadedReply(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.setThreadedCommentResolved — Function
setThreadedCommentResolved(sheet, ref, resolved=true)
setThreadedCommentResolved(sheet, row, col, resolved=true)Mark a cell's threaded comment resolved, or (false) open again. The file must be writable.
setThreadedCommentResolved(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.deleteThreadedComment — Function
deleteThreadedComment(sheet, ref) -> Bool
deleteThreadedComment(sheet, row, col) -> BoolRemove a cell's threaded comment, with its replies and its note. Returns whether there was one. The file must be writable.
deleteThreadedComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getThreadedComment — Function
getThreadedComment(sheet, ref) -> Union{Nothing, NamedTuple}
getThreadedComment(sheet, row, col) -> Union{Nothing, NamedTuple}A cell's threaded comment, as (sheet, ref, author, text, date, resolved, replies), each reply (author, text, date), or nothing. author is the person's display name.
getThreadedComment(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getThreadedComments — Function
getThreadedComments(sheet) -> Vector{NamedTuple}
getThreadedComments(ods::ODSFile) -> Vector{NamedTuple}Every threaded comment of a sheet, or of every sheet, as getThreadedComment gives them, by row and then column.
Pictures
Pictures anchored in cells, resizing with them:
OpenDocumentSpreadsheets.addImage — Function
addImage(sheet, ref, image; size=nothing, inCell=false, alt="", description="") -> NamedTuple
addImage(sheet, row, col, image; kw...) -> NamedTupleInsert a picture (PNG, JPEG or GIF, from a file path or an IOBuffer, which is left unchanged) over the cells from ref: anchored in the first cell and resizing with its cells up to the last. For a cell, the picture covers one cell per 64 pixels of its width and per 20 of its height (its own size, or size = (width, height) in pixels); for a range ("B2:D6"), the range. The picture is stored once in the file, however many times it is shown.
alt is the picture's short description for readers who can't see it, and description its longer one: the Text and Alt Text fields of LibreOffice's Format ▸ Alt Text. LibreOffice has no pictures in cells: inCell=true is an error.
Returns (sheet, media_name, from, to, alt, description). The file must be writable.
addImage(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getImages — Function
getImages(sheet) -> Vector{NamedTuple}
getImages(ods::ODSFile) -> Vector{NamedTuple}The pictures of a sheet, or of every sheet, as (sheet, media_name, from, to, alt, description), by their first cell: those anchored in cells or to the page, read from the file or added. to is the cell a picture ends in. media_name is its part's name in Pictures/ ("" for a picture held in a flat file).
OpenDocumentSpreadsheets.deleteImage — Function
deleteImage(sheet, ref) -> Int
deleteImage(sheet, image::NamedTuple) -> IntRemove the pictures whose first cell is ref ("B3"), or the picture image (as getImages gives it). Returns how many were removed. Pictures anchored to the page can't be removed this way. The file must be writable.
deleteImage(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
Data validation
The rules of LibreOffice's Data ▸ Validity:
OpenDocumentSpreadsheets.addDataValidation — Function
addDataValidation(sheet, rng; type, operator, formula1, formula2, values, allowBlank=true, dropdown,
showInputMessage=true, promptTitle, prompt, showErrorMessage=true, errorTitle, error,
errorStyle=:stop, caseSensitive=false, sortEntries=false) -> NamedTuple
addDataValidation(ods, "Sheet1.B2:B20"; kw...)Restrict what may be typed into the cells of rng (a cell, range, whole columns "B:B" or rows, a list of ranges "A1:A5,C1:C5", or a defined name), as LibreOffice's Data ▸ Validity does.
type is :list, :whole, :decimal, :date, :time, :textLength, :custom or :any (:list when values is given). For the number, date, time and length types, operator is :between (the default), :notBetween, :equal, :notEqual, :greaterThan, :lessThan, :greaterThanOrEqual or :lessThanOrEqual, with formula1 (and formula2 for the two between forms). formula1 and formula2 are numbers, a Date, Time or DateTime, or a reference or formula in LibreOffice's notation ("$D$1:$D$3", "Lists.$A$1:$A$9", or "Lists!$A$1:$A$9"; "=ISNUMBER(B2)"). A list's items may be given as values.
allowBlank, dropdown (a list's drop-down), showInputMessage with prompt and promptTitle, and showErrorMessage with error, errorTitle and errorStyle (:stop, :warning, :information) set the input help and error alert. As in LibreOffice, a cell has one validation: a new one replaces the validation of the cells it covers. Identical validations share one rule.
Two more options: caseSensitive (lists and comparisons with text tell upper and lower case apart) and sortEntries (a :list's drop-down shows its items sorted ascending).
Returns the validation, as getDataValidation reads it. An :any validation without a prompt or error message restricts nothing, and LibreOffice stores none: it removes the validation of its cells, and nothing is returned. The file must be writable.
addDataValidation(sh, "D2:D20"; values = ["Open", "Paid", "Late"]) # a drop-down list
addDataValidation(sh, "E2:E20"; type = :whole, operator = :between, formula1 = 1, formula2 = 10,
errorTitle = "Quantity", error = "Enter a whole number from 1 to 10.")
addDataValidation(sh, "F2:F20"; type = :date, operator = :greaterThanOrEqual,
formula1 = Date(2026, 1, 1), prompt = "A date in 2026 or later")OpenDocumentSpreadsheets.getDataValidation — Function
getDataValidation(sheet, ref) -> Union{Nothing, NamedTuple}
getDataValidation(sheet, row, col) -> Union{Nothing, NamedTuple}The validation of a cell, as getDataValidations gives it (its range all its cells on the sheet), or nothing.
getDataValidation(ods::ODSFile, "Sheet1.A1", args...; kw...)The same, on a cell or range given with its sheet.
OpenDocumentSpreadsheets.getDataValidations — Function
getDataValidations(sheet) -> Vector{NamedTuple}
getDataValidations(ods::ODSFile) -> Vector{NamedTuple}Every validation of a sheet, or of every sheet: (sheet, range, type, operator, formula1, formula2, allowBlank, dropdown, showInputMessage, promptTitle, prompt, showErrorMessage, errorTitle, error, errorStyle, caseSensitive, sortEntries) (see addDataValidation). range is a CellRange, or a NonContiguousRange for several areas; formulas are in LibreOffice's notation, without = (a list's items as "a","b"); operator is nothing for :list, :custom and :any. In the file's order.
OpenDocumentSpreadsheets.deleteDataValidation — Function
deleteDataValidation(sheet, rng) -> Int
deleteDataValidation(ods, "Sheet1.B2:B20") -> IntRemove every validation whose cells all lie inside rng (the forms of addDataValidation; : for the whole sheet), from all its cells on the sheet. Returns how many were removed. A rule no cell uses any more is dropped from the file when it is saved, as LibreOffice drops it. The file must be writable.
Tables
Tables are LibreOffice's database ranges (Data ▸ Define Range). LibreOffice has no styles for them, and keeps no totals settings: they are read from the totals cells' formulas.
OpenDocumentSpreadsheets.Table — Type
TableA table: a named range of a sheet whose first row holds the column labels (LibreOffice's database range, Data ▸ Define Range). Obtain one with table or tables, make one with addtable!. A Table is a Tables.jl table of its data rows (DataFrame(t)), as gettable reads them.
Fields
id::Int: its number among the workbook's tables, in the file's order (LibreOffice has no ids: deleting a table renumbers those after it)name::String: its name, unique in the workbook ignoring case;display_nameis the sameref::CellRange: its cells, with the header row and any totals rowcolumns::Vector{String}: the column labels, from the header row ("Column B"for an empty one, and for every column of a table without a header, as LibreOffice names them)has_header_row::Bool: whether the first row holds the labels (LibreOffice's Contains column labels)has_totals_row::Bool: whether the last row holds the totals (Contains totals row)style: alwaysnothing(LibreOffice has no table styles)sheet: theWorksheetfilterButtons::Bool: whether the header shows filter buttons (LibreOffice's)
A Table is a snapshot: the functions that change a table return a new one.
OpenDocumentSpreadsheets.TableStyleInfo — Type
TableStyleInfoA table style: a name and four stripe and column flags. LibreOffice has no styles for database ranges, so a Table's style is always nothing.
OpenDocumentSpreadsheets.tables — Function
tables(sheet) -> Vector{Table}
tables(ods::ODSFile) -> Vector{Table}The tables of a sheet, or of the workbook, in the file's order: LibreOffice's named database ranges (sheets' anonymous ones, which hold their autofilters, are not tables).
OpenDocumentSpreadsheets.table — Function
table(sheet, name) -> Table
table(sheet, id::Integer) -> Table
table(ods::ODSFile, name) / table(ods, id)A table by name (ignoring case, as LibreOffice compares them) or number, on the sheet or in the workbook. A KeyError if there is none.
OpenDocumentSpreadsheets.addtable! — Function
addtable!(sheet, ref; name="", style=nothing, has_totals_row=false, has_header_row=true,
filterButtons=true) -> TableMake the cells ref ("A1:C10") a table, as LibreOffice's Data ▸ Define Range makes a database range. The cells are not changed: the first row must already hold the column labels, each given and none repeated (ignoring case).
name is LibreOffice's: formed as a defined name's, and unique among the workbook's tables ignoring case (it may be a defined name's too, as LibreOffice allows); "" gives the first free TableN. has_totals_row=true makes the last row the totals row (see settotals!); its cells are left as they are. LibreOffice has no table styles: style other than nothing or "None" is an error.
Options: has_header_row=false makes a table whose first row is data (its columns are then named "Column A", …), and filterButtons=false hides the header's filter buttons, which a table shows by default.
As in LibreOffice, tables may overlap each other and merged cells, and a table may be its header row alone. The file must be writable.
OpenDocumentSpreadsheets.deletetable! — Function
deletetable!(t::Table)
deletetable!(sheet, name) / deletetable!(sheet, id::Integer)Remove a table (LibreOffice's database range), leaving its cells as they are, as LibreOffice's Define Range ▸ Delete does. Totals formulas already refer to the cells (LibreOffice stores no table references), so they are unchanged. The file must be writable.
OpenDocumentSpreadsheets.settotals! — Function
settotals!(t::Table, settings::Pair...) -> Table
settotals!(t::Table; kwargs...) -> Table
settotals!(sheet, name | id, settings::Pair...) / settotals!(sheet, name | id; kwargs...)Set a table's totals: each setting is "column" => value (or column = value), where value is a totals function (:sum, :average, :count, :countnums, :max, :min, :stddev, :var), (:custom, formula), a text label, or :none to clear the column's cell. Columns not given are left as they are. A table without a totals row gets one: the row after its last, which must be empty, and the table grows by it (LibreOffice's Contains totals row, calcext:contains-footer).
A function is written as the formula LibreOffice saves for it: SUBTOTAL(109,…) over the column's data rows, as an absolute range. A custom formula is in LibreOffice's notation; structured references to the table in it (Sales[Revenue], Sales[[#All],[Revenue]]) are written as ranges too. The file must be writable.
OpenDocumentSpreadsheets.gettotals — Function
gettotals(t::Table) -> NamedTuple
gettotals(sheet, name | id) -> NamedTupleA table's totals row by column name, each (setting, formula, value): the totals function (:sum, …), :custom, :label or :none (read from the cell, as LibreOffice keeps no setting: a function is a SUBTOTAL of the column's data rows), the cell's formula (LibreOffice's notation, or nothing) and its value (missing for a formula OpenDocumentSpreadsheets wrote, until LibreOffice computes it). An empty NamedTuple if the table has no totals row.
OpenDocumentSpreadsheets.deletetotals! — Function
deletetotals!(t::Table) -> Table
deletetotals!(sheet, name | id) -> TableRemove a table's totals row: its cells are emptied and the table loses the row. Nothing changes for a table without one. The file must be writable.
OpenDocumentSpreadsheets.appendtable! — Function
appendtable!(t::Table, data; check_empty=true) -> Table
appendtable!(sheet, name | id, data; check_empty=true) -> TableAdd rows to the end of a table: data is a Tables.jl table (its columns matched by name), a matrix or a vector of rows (matched by position). The table grows over them. A totals row moves down to stay last: its functions are written again over the new data rows, its labels kept, and its custom formulas' references to the old data rows made to reach the new ones. The rows below the table must be empty, unless check_empty=false. The file must be writable.
OpenDocumentSpreadsheets.gettablerange — Function
gettablerange(t::Table) -> SheetCellRange
gettablerange(t::Table, column; header=false) -> SheetCellRange or SheetCellRef
gettablerange(t::Table, first, last) -> SheetCellRangeA table's data rows (without its header and totals rows) as a sheet-qualified range: all its columns, one (by name or number; with header=true, that column's header cell), or the columns from first to last. The table is looked up again, so t may be from before it changed.
AutoFilters
A sheet's AutoFilter is LibreOffice's anonymous database range of the sheet, with filter buttons. Its criteria are stored as LibreOffice stores them, and rows are hidden as LibreOffice's Refresh Range hides them; a sort puts the rows in LibreOffice's order and moves what LibreOffice's Data ▸ Sort moves.
OpenDocumentSpreadsheets.setAutoFilter — Function
setAutoFilter(sheet, rng; filters=nothing, sort=nothing, caseSensitive=false, noDuplicates=false,
naturalSort=false, includeFormats=true)
setAutoFilter(ods, "Sheet1.A1:D20"; kw...)Add filter buttons to the first row of rng, as LibreOffice's Data ▸ AutoFilter does, stored as LibreOffice stores a sheet's AutoFilter: the sheet's anonymous database range. rng is a range of cells ("A1:D20"), a defined name, or : for the sheet's used range. Its first row is the header row.
A sheet has one AutoFilter, so this replaces any the sheet has. It may not overlap a table (see addtable!). Setting the filter again on the same range keeps its criteria and sort, unless new ones are given. With both, the rows are sorted first and then filtered, as LibreOffice does.
Filtering
filters gives criteria for some of the columns, as pairs of a column and a criterion. A column is given by its header text, its column letter or its position in the range (1 for the first). Rows a criterion doesn't show are hidden (as LibreOffice hides them, table:visibility="filter") and the others shown, so the file opens filtered, as LibreOffice would have saved it. A row is shown if it meets the criteria of every filtered column. A criterion is one of:
- a value, or a vector of values, to show: text (in any case), numbers, dates,
true/false, andmissingfor empty cells. - a condition,
op => value, whereopis"==","!=",">",">=","<"or"<="andvaluea number, a date or text. With"=="and"!=", text may use wildcards:*for any characters,?for any one, and~before one of them for itself."!=" => ""shows the cells that aren't empty. - two conditions joined by
:andor:or:(">=" => 10, :and, "<" => 20). (:top, n)or(:bottom, n)for thenlargest or smallest numbers, or(:top, n, :percent)and(:bottom, n, :percent)for a percentage of the cells.- a regular expression,
r"^a.*z$"or"!=" => r"…"(it must match the whole cell's text).
Criteria are applied as LibreOffice's Refresh Range applies them:
- Text that LibreOffice reads as a number (
"10","1,000","(1)","2026-11-23 15:00") is compared with numbers as that number, and with text as text; other text is compared with the text a number shows ("50%","TRUE"). A number is compared only with numbers. - Values in a list are compared as such text, so
[10]shows the text"10"too, and a date shows cells of that date at midnight, not later that day. - A ranking counts every cell that isn't empty, and sorts text and errors above the largest numbers.
"!=" => ""treats a formula giving""as empty, whilemissingshows only cells holding nothing.
LibreOffice has no above- or below-average or relative-date filters (:aboveAverage, :today, :Q1, …): they are errors.
Options: caseSensitive=true compares text in its case, and noDuplicates=true hides rows that show the same as a row above them (always comparing case), as LibreOffice's No duplications. noDuplicates applies to the criteria given, so it needs filters, and LibreOffice applies it only with at least one criterion.
filters=[] removes the criteria and shows every row of the range.
Sorting
sort gives a column, column => :ascending or column => :descending, or a vector of these, the first sorting first. The rows below the header are put in that order, as LibreOffice's Data ▸ Sort puts them, and the sort is stored with the range:
- ascending: numbers and dates, with
FALSEandTRUEas 0 and 1; then text, in LibreOffice's alphabetical order (ignoring case, and accents but where they alone differ); then errors. Descending reverses this. Empty cells are last either way, and rows that compare equal keep their order. - each row's cells in the range move with their formats, validations, notes, links and pictures, and its hidden state goes with it; a formula moves as if copied, so
=B5*2in row 5 becomes=B2*2in row 2, and is saved without a value (LibreOffice computes it on loading). Cells outside the range's columns, row heights, and formulas and names that refer to the sorted cells stay as they are, as in LibreOffice. - a range with merged cells is refused (LibreOffice sorts it only without formats), and so is one with an array formula.
Options: caseSensitive=true (shared with the criteria) puts lower case before upper case where text is otherwise equal; naturalSort=true compares the numbers within text by value ("a2" before "a10"); includeFormats=false leaves the formats and validations where they are and moves only the values, notes, links and pictures (which allows merged cells).
The file must be writable.
st = addsheet!(ods, "Stock")
st["A1:B1"] = ["Colour" "Amount"]
for (i, (colour, amount)) in enumerate([("Red", 120), ("Green", 80), ("Blue", 150), ("Red", 60)])
st[i+1, 1] = colour; st[i+1, 2] = amount
end
setAutoFilter(st, :) # drop-down buttons on the header, over the used area
# only the red and blue rows over 100 show, largest first
setAutoFilter(st, "A1:B5"; filters = ["Colour" => ["Red", "Blue"], "Amount" => (">" => 100)],
sort = "Amount" => :descending)See also getAutoFilter and deleteAutoFilter.
OpenDocumentSpreadsheets.getAutoFilter — Function
getAutoFilter(sheet) -> Union{Nothing, CellRange}The range of the sheet's AutoFilter (see setAutoFilter), or nothing if it has none: LibreOffice's anonymous database range of the sheet, when it shows filter buttons. Tables' filters are not included. Works on read-only files.
OpenDocumentSpreadsheets.deleteAutoFilter — Function
deleteAutoFilter(sheet) -> BoolRemove the sheet's AutoFilter and its criteria, as turning off LibreOffice's Data ▸ AutoFilter does: every row below the header is shown, those hidden by hand too, and the sheet keeps its anonymous database range without filter buttons or criteria. Returns false if the sheet had no AutoFilter.
The file must be writable.