a11ytables icon indicating copy to clipboard operation
a11ytables copied to clipboard

Output to ODS

Open matt-dray opened this issue 2 years ago • 5 comments

ODS files are the ideal output for publication, as indicated in the GOV.UK and GSS guidance.

Workbook-class objects created with {openxlsx} can't be written directly to ODS (?), you have to go with saveWorkbook() in the first instance.

Perhaps provide guidance rather than functionality? I think all the styling and markup are lost if you try to read in an Excel file, then save out to ODS.

matt-dray avatar Mar 04 '22 10:03 matt-dray

To note: this is something that the gptables team would also like to solve, but is also proving difficult in Python given the limits of the xlsx-related packages being wrapped.

matt-dray avatar Jul 06 '22 09:07 matt-dray

At least for now, could we do something like:

system("libreoffice --headless --convert-to ods output-file.xlsx")

Which requires LibreOffice to be installed, of course.

Surely this is better than nothing?

matt-dray avatar Jul 29 '22 13:07 matt-dray

Also suggested by Jan: https://github.com/JanMarvin/openxlsx2/discussions/574#discussioncomment-5552573

matt-dray avatar Apr 18 '23 10:04 matt-dray

@DIPAD-Fran-Bryden pointed out a convert_to_ods() function in {dftutils} (thank you!); could add documentation to {a11ytables} to suggest using this approach.

matt-dray avatar Nov 27 '23 11:11 matt-dray

@matt-dray To note as well, we used to use Excel when we were running R locally; no longer relevant to DfT but may be of interest to people without a Cloud setup? Or anyone who loves a good bit of VBS... https://github.com/department-for-transport/odsconvertr/blob/main/R/save_files.R

DIPAD-Fran-Bryden avatar Nov 27 '23 11:11 DIPAD-Fran-Bryden