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

conditionalFormatting: "Catastrophic failure" with databar #522

Open
Arthfael opened this issue Nov 10, 2020 · 2 comments
Open

conditionalFormatting: "Catastrophic failure" with databar #522

Arthfael opened this issue Nov 10, 2020 · 2 comments

Comments

@Arthfael
Copy link

Arthfael commented Nov 10, 2020

Expected Behavior

Function conditionalFormatting with type = "databar" should format the column as a databar

Actual Behavior

All of the variant calls I have tested corrupt the formatting of the worksheet. When opening the worksheet in Excel, the program reports that it found a problem with the workbook and offers to repair the records. It then reports repairing a catastrophic failure (strangely, at line 15, column 0 - which has nothing to do with the target column). The "databar" formatting of the target column is lost, and in addition all formatting in columns right of the target column disappears.

In addition, the help says that "style" should be length 2 or 3, but if length 3 is used, an error says it should be length 1 or 2.

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

  1. Create wb with one sheet and write one column of numerical data
  wb <- createWorkbook()
  sheet  <- addWorksheet(wb, "Protein Data")
  writeData(wb, "Protein Data", rep(1, 10))
  1. Function call (all the variants I tested failed):
    conditionalFormatting(wb, 1, 1, 2:5, type = "databar") # For instance, to apply to only part of the column

  2. Save workbook and open in Excel:

  saveWorkbook(wb, "test.xlsx", TRUE)
  shell("\"test.xlsx\"")

sessionInfo()

  • Version of openxlsx: 4.1.4
  • Version of R: version 3.6.1 (2019-07-05), R studio 1.3.1073
@shitongbin
Copy link

same +1

@ycphs
Copy link
Contributor

ycphs commented Mar 27, 2021

Could you please create this also at ycphs/openxlsx?

I am maintaining the active fork of the package.

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

3 participants