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_load] xml cleanup #362

Merged
merged 3 commits into from
Oct 8, 2022
Merged

[wb_load] xml cleanup #362

merged 3 commits into from
Oct 8, 2022

Conversation

JanMarvin
Copy link
Owner

@JanMarvin JanMarvin commented Oct 6, 2022

  • cleanup of baseXML
  • fix opening workbooks with slicer
  • fix cloning pivot charts

Unfortunately I didn't check loading sheets with and without slicers or I misinterpreted the errors I saw when cloning slicers.

# clone sheet with pivotTable (and drop slicer)
wb <- wb_load(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx2"))$
  clone_worksheet(old = "irisSample", new = "clone 1")$
  open()

inds can be 0 if no slicer is found. in our loadExample loading slicers will fail.
@JanMarvin JanMarvin changed the title Xml cleanup [wb_load] xml cleanup Oct 6, 2022
@JanMarvin
Copy link
Owner Author

This will clone the slicer, but it will be a complete copy of the original slicer. Any selection will impact the original pivot table. Might require a clone of slicerCache.

wb <- wb_load(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx2"))$
  clone_worksheet(old = "irisSample", new = "clone 1")

wb$drawings[5][[1]] <- gsub(
  "name=\"Species\"",
  "name=\"Species_n\"",
  wb$drawings[5][[1]]
)

wb$open()

This was referenced Oct 6, 2022
@JanMarvin JanMarvin merged commit b674dab into main Oct 8, 2022
@JanMarvin JanMarvin deleted the xml_cleanup branch October 8, 2022 06:47
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

Successfully merging this pull request may close these issues.

None yet

1 participant