Skip to content

More than one databar destroys the workbook #520

@joshuasami

Description

@joshuasami

Describtion
Hey, I'm running in to a problem, when I add databars, via conditionalFormatting, into my workbook. One Databar works fine, but I when I add two Databars, my workbook saves, but I can't open it anymore afterwards.

The same bug was already described here: /issues/42

To Reproduce

library(openxlsx)
wb <- createWorkbook()
sheet_name <- "sheet 1"
addWorksheet(wb, sheet_name)
df <- data.frame(
  A = 1:10,
  B = 11:20
)
writeDataTable(wb, sheet_name, df, tableStyle = "TableStyleMedium9")
for (col in 1:2) {
  conditionalFormatting(
    wb,
    sheet_name,
    cols = col,
    rows = 2:(nrow(df) + 1),
    type = "databar",
    style = c("#ffb628", "#ffb628"),
    gradient = FALSE,
    border = FALSE
  )
}
saveWorkbook(wb, "test.xlsx", overwrite = TRUE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions