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

Warning in dataValidation(type = "list") #342

Closed
tentacles-from-outer-space opened this issue Apr 11, 2022 · 8 comments
Closed

Warning in dataValidation(type = "list") #342

tentacles-from-outer-space opened this issue Apr 11, 2022 · 8 comments
Labels
fixed Fixed, issue will be closed within 7 days Stale

Comments

@tentacles-from-outer-space
Copy link
Contributor

dataValidation(type = "list") generates warning warning because of redundant argument to sprintf:

https://github.com/ycphs/openxlsx/blob/d8c8209a42b7ec58e0066ccba9ea8a748ad77f16/R/WorkbookClass.R#:~:text=data_val%20%3C%2D%20sprintf(%27%3Cx14,showInputMsg%2C%20showErrorMsg%2C%20sqref)

Instead of

data_val <- sprintf('<x14:dataValidation type="list" allowBlank="%s" showInputMessage="%s" showErrorMessage="%s">',
                      allowBlank, showInputMsg, showErrorMsg, sqref)

should be

data_val <- sprintf('<x14:dataValidation type="list" allowBlank="%s" showInputMessage="%s" showErrorMessage="%s">',
                      allowBlank, showInputMsg, showErrorMsg)
@wleoncio
Copy link
Contributor

wleoncio commented Jun 15, 2022

Adding reprex (extracted from example(dataValidation) on openxlsx 4.2.5.1):

library(openxlsx)
wb <- createWorkbook()
addWorksheet(wb, "Sheet 1")
addWorksheet(wb, "Sheet 2")

writeDataTable(wb, sheet = 1, x = iris[1:30, ])
writeData(wb, sheet = 2, x = sample(iris$Sepal.Length, 10))

dataValidation(wb, 1, col = 1, rows = 2:31, type = "list", value = "'Sheet 2'!$A$1:$A$10")
#> Warning in sprintf("<x14:dataValidation type=\"list\" allowBlank=\"%s\"
#> showInputMessage=\"%s\" showErrorMessage=\"%s\">", : one argument not used by
#> format '<x14:dataValidation type="list" allowBlank="%s" showInputMessage="%s"
#> showErrorMessage="%s">'

Created on 2022-06-15 by the reprex package (v2.0.1)

@wleoncio wleoncio mentioned this issue Jun 15, 2022
@deschen1
Copy link
Contributor

deschen1 commented Jul 6, 2022

@JanMarvin I can confirm the warning message is gone in the current development branch (not sure if you want to be actively tagged, but since you asked if someone could test the changes in the dev branch, I thought you'd want to).

@wleoncio
Copy link
Contributor

Thanks for testing, @deschen1! I understand the repo is basically no longer maintained, but it would be nice if someone would close this issue since it's solved.

@JanMarvin JanMarvin added the fixed Fixed, issue will be closed within 7 days label Jul 13, 2022
@JanMarvin
Copy link
Collaborator

Rest assured, this repository is still maintained. The last merge to development was just yesterday. We might not always be the fastest, but not actively developing and not being maintained are different things.
People just have different things to do in life and some of us have to work for a living 😉 There will be new releases with bugfixes etc, just not at the moment.

@wleoncio
Copy link
Contributor

wleoncio commented Jul 14, 2022

not actively developing and not being maintained are different things

You're right, sorry for misspeaking. Great to know there are new releases on the horizon!

@IRorpa

This comment was marked as off-topic.

@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 30, 2023
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Oct 7, 2023
JanMarvin pushed a commit that referenced this issue Aug 11, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 4, 2025
# openxlsx 4.2.7.1

* It's now possible to insert a hyperlinked image by passing a URL,
  relative or absolute file path, or mailto string to the new
  `address` parameter of `insertImage()`.

# openxlsx 4.2.7

* Fixed warning on `dataValidation(..., type = "list")`
  ([#342](ycphs/openxlsx#342))

* Added optional argument to `loadWorkbook` to decide if empty/blank
  cells should be converted to NA_character_ (the default) or left
  blank as is

* `saveWorkbook()` now succeeds when called after the user has set
  column widths for a range of columns (e.g. 1:2), saved the workbook,
  then set column widths for a new range that is inclusive of the
  previous one (e.g. 1:5)
  ([#493](ycphs/openxlsx#493)).

## Improvements

* Improve detectDates
  ([#288](ycphs/openxlsx#288))

* Preserve window size and position, also `getWindowSize()` and
  `setWindowSize()`
  ([466](ycphs/openxlsx#466))

# openxlsx 4.2.6

* Fix external links
  ([#410](ycphs/openxlsx#410))

* Do not add unneccessary sheetPr node
  ([#409](ycphs/openxlsx#409))

* Add support for `namedRegion`s having dots and other special
  characters ([#338](ycphs/openxlsx#338)).

* Add type blanks and not blanks to conditional formatting
  ([#311](ycphs/openxlsx#311))

# openxlsx 4.2.5

## Fixes

* `openxlsx_setOp()` now works with named list
  ([#215](ycphs/openxlsx#215))

* `loadWorkbook()` imports `inlineStr`. Values remain `inlineStr` when
  writing the workbook with `saveWorkbook()`. Similar `read.xlsx` and
  `readWorkbook` import `inlineStr`.

* `read.xlsx()` no longer changes random seed
  ([#183](ycphs/openxlsx#183))

* fixed a regression that caused fonts to be read in incorrectly
  ([#207](ycphs/openxlsx#207))

* add option to save as read only recommended
  ([#201](ycphs/openxlsx#201))

* fixed writing hyperlink formulas
  ([#200](ycphs/openxlsx#200))

* `write.xlsx()` now throws an error if it doesn't have write
  permissions ([#190](ycphs/openxlsx#190))

* `write.xlsx()` now again uses the default of `overwrite = TRUE` for
  saving files ([#249](ycphs/openxlsx#249))

* `as.character.formula()` exported to warn about potential conflicts
  with other packages
  ([#312](ycphs/openxlsx#312),
  [#315](ycphs/openxlsx#315))

## Improvements

* `options()` are more consistently set in functions (see:
  [#289](ycphs/openxlsx#262))

* `Workbook$show()` no longer fails when called in a 0 sheet
  workbook([#240](ycphs/openxlsx#240))

* `read.xlsx()` again accepts `.xlsm` files
([#205](ycphs/openxlsx#205),
[#209](ycphs/openxlsx#209))

* `makeHyperlinkString()` does no longer require a sheet argument
  ([#57](ycphs/openxlsx#57),
  [#58](ycphs/openxlsx#58))

* improvements in how `openxlsx` creates temporary directories (see
  [#262](ycphs/openxlsx#262))

* `writeData()` calls `force(x)` to evaluate the object before options
  are set ([#264](ycphs/openxlsx#264))

* `createComment()` now correctly handles `integers` in `width` and
  `height` ([#275](ycphs/openxlsx#275))

* `setStyles()` accepts `halign="justify"`
  ([#305](ycphs/openxlsx#305))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Fixed, issue will be closed within 7 days Stale
Projects
None yet
Development

No branches or pull requests

5 participants