-
Notifications
You must be signed in to change notification settings - Fork 11
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
[write] add params
argument to wb_add_data_table()
#1126
base: main
Are you sure you want to change the base?
Conversation
9c71115
to
302ff69
Compare
This PR requires testing. Especially how it works in comparison with spreadsheet software. How is does this work compared to spreadsheet software and how does this work in comparison with other strange things thrown at it? Like custom filters. |
302ff69
to
d18e141
Compare
autofilter_ref <- ref | ||
} | ||
xml_node_create(xml_name = "autoFilter", xml_attributes = c(ref = autofilter_ref)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is autofilter if not TRUE? NULL? Something else?
d18e141
to
9d91d93
Compare
Maybe it is better to not use params but choose directly, but I'm not gonna change it right now |
9328c79
to
461b815
Compare
…o filter a table with `choose`. Similar to how it is done in `wb_add_pivot_table()`.
461b815
to
27344f5
Compare
In openxml it is possible to have at least two conditions per column filter. This is not covered by this PR and wont be included. This choose <- c(
cyl = "x > 14 & x <= 20",
am = "x == 3 | x == 5"
) should result in this <autoFilter ref="A1:K33">
<filterColumn colId="0">
<customFilters and="1">
<customFilter operator="greaterThan" val="14" />
<customFilter operator="lessThanOrEqual" val="20" />
</customFilters>
</filterColumn>
<filterColumn colId="9">
<filters>
<filter val="3" />
<filter val="5" />
</filters>
</filterColumn>
</autoFilter> Conditions with |
Tip
This pull request is not gonna get merged unless somebody tries it. It can cause surprising behavior and I'm not gonna gamble here. If you want it included. Give it a try. Create a test parkour to check
openxlsx2
vs Excel behavior. Let me know what works and what not.Which allows to filter a table with
choose
. Similar to how it is done inwb_add_pivot_table()
.