Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wb_update_table doesn't work with tables with no filter #802

Closed
sxl634 opened this issue Sep 28, 2023 · 3 comments
Closed

wb_update_table doesn't work with tables with no filter #802

sxl634 opened this issue Sep 28, 2023 · 3 comments

Comments

@sxl634
Copy link

sxl634 commented Sep 28, 2023

If you use wb_update_table which does not have an auto filter, you'll get the following error:

  • Error: Expecting a single string value: [type=character; extent=0].

In the documentation, the following example is used and works:

wb <- wb_workbook()$add_worksheet()$add_data_table(x = mtcars)
wb$update_table(tabname = "Table1", dims = "A1:J4")

However, if you adjust this example such that no filter is provided when adding the data table as seen below, you get the error mentioned above:

wb <- wb_workbook()$add_worksheet()$add_data_table(x = mtcars, with_filter = FALSE)
wb$update_table(tabname = "Table1", dims = "A1:J4")

This is because the autofilter node does not exist, but the wb_update_table function requires there to be an autofilter. Can this be fixed such that an autofilter is not required?

@JanMarvin
Copy link
Owner

Thanks for the report @sxl634 , that should be possible. I'll have a look before the next release.
I was a little careful, because of unintended table options.

@JanMarvin
Copy link
Owner

A potential fix is in main. Could you check if this solves your problem @sxl634 ?

PS: There might be other xml nodes for tables, maybe I'll add a follow up commit to check if we got all nodes.

@sxl634
Copy link
Author

sxl634 commented Sep 30, 2023

Looks like it worked based on the example I used! Thanks @JanMarvin! V impressed with the speedy fix. Will let you know if I encounter anything else, really liking the package so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants