ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
221 stars 74 forks source link

Add auto row_heights feature #373

Closed David-Rattray closed 2 years ago

David-Rattray commented 2 years ago

Hi @JanMarvin,

Here is the fork with the updates from @DavidBreuer 's code.

As I mentioned in the issue (#367 ) thread, I've encountered an error with Error in write_worksheet_xml_2(prior = prior, post = post, sheet_data = ws$sheet_data, : Not compatible with STRSXP: [type=NULL].

I think it stems from having non-null row heights in the workbook when I go to write, and the write function write_worksheet_xml_2 <- function(prior, post, sheet_data, row_heights_ = NULL, outline_levels_ = NULL, R_fileName = "output") { .Call(_openxlsx_write_worksheet_xml_2, prior, post, sheet_data, row_heights_, outline_levels_, R_fileName) }

However it is just a hunch

JanMarvin commented 2 years ago

Hi @David-Rattray , I've rebased your changes on our development branch (should mention this in the README.md) and fixed the issue (rowHeights should be characters not integer/numerics). I've opened a new PR for this in #375. I haven't done any feature tests, that is up to you. The code should be cleaned up a bit, no need to comment every line for instance. And I'd love to see a test for this and backward testing, we do not want to surprise other users of our code.

JanMarvin commented 2 years ago

Ofc you should take over the PR once again (I just didn't want to push to your branch). And usually it's a good idea to create pull requests from branches with unique names.

JanMarvin commented 2 years ago

Closing in favor of #375