Skip to contents

Writes one worksheet per table. This is deliberately one-way: a spreadsheet cell holds a single value, so several SeaTable column types have no faithful representation.

Usage

hb_write_xlsx(x, path, ..., tables = NULL)

Arguments

x

A harbour_dtable, or a harbour_client to read from first.

path

Destination .xlsx path.

...

These dots are for future extensions and must be empty.

tables

Table names to export. Default: all of them.

Value

path, invisibly.

What is lost

  • multiple-select, collaborator and image cells are joined with ", ".

  • file cells are reduced to their file names.

  • link and link-formula cells reference rows in other tables and are exported as their display values.

  • formula columns export their computed value, not the formula.

  • Views, filters, colours, column widths and every other piece of base configuration have no cell to live in.

harbouR reports which columns were flattened. To keep everything, write a .dtable with hb_write_dtable() instead.

Examples

base <- hb_read_dtable(
  system.file("extdata", "example.dtable", package = "harbouR")
)
out <- tempfile(fileext = ".xlsx")
hb_write_xlsx(base, out)
#> ! 7 columns were flattened to text.
#> • Samples$Tags, Samples$Collaborators, Samples$Photos, Samples$Reports,
#>   Samples$Where, Samples$Action, and Samples$Signature
#> ℹ A spreadsheet cell holds one value. Use `hb_write_dtable()` to keep the
#>   structure.