-
Notifications
You must be signed in to change notification settings - Fork 32
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
getColumnWidth #163
Comments
Thanks so much for reaching out here @Sasawaws, and apologies for the delayed response! COVID has kept me busy 😄 Well done finding the details here!! The parts of the POI API that are not exposed through the package are definitely usable and accessible (and PRs are welcome!), but there are some tricks to doing so. Try something like this: tmp <- function (sheet, colIndex) {
as.integer(lapply(colIndex-1, function(.x) {rJava::.jcall(sheet, "I",
"getColumnWidth", as.integer(.x))}))
}
library(xlsx)
wb <- createWorkbook()
s <- createSheet(wb)
addDataFrame(iris, sheet = s)
tmp(s, 1)
#> [1] 2048
tmp(s, 1:3)
#> [1] 2048 2048 2048 Created on 2020-09-12 by the reprex package (v0.3.0) When calling a function in Java, you have to define the input as well as the return type. Since About halfway down the page here: https://www.rforge.net/rJava/ Ooh, another fun trick:
I should really create a contributing guide or something. 😄 There is a bunch of good stuff in the Apache POI package that we have not exported in this package. I'll leave this issue open until we implement a |
A contributing guide would be great |
That's a great call!! I will work on that 😄 |
I'd like a "getColumnWidth" so I've tried adding it into the library but I get an error:
method getColumnWidth with signature (I)V not found
getColumnWidth is in the POI API, I suspect the problem lies in the fact that I only have 20 minutes experience with R and haven't used java for 10 years but it looks to me that I need to declare something somewhere but haven't.
I wondered if you might be able to advise?
Thanks
The text was updated successfully, but these errors were encountered: