You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have been using the xlsx package for a while, it's been very helpful to me. I
recently noticed a bug when formatting is applied to entire columns and I use
CellBlock. When using CellBlock with format applied to entire columns, some of
the cells loose their formatting when saving the workbook. However, if format
is only applied to cells, this problem doesn't arise. The problem I'm facing in
my application is that the initial Excel spreadsheets are created by clients
and they may apply formats over entire columns
Thanks a lot for your help,
Benoit
Here is a short reproducible example (the files "bad_format.xlsx" and
"good_format.xlsx" are attached):
library("xlsx")
wb <- loadWorkbook("bad_format.xlsx") #using formatting on entire columns (A to
L)
sh <- getSheets(wb)
s1 <- sh[[1]]
cb <- CellBlock(sheet = s1, startRow = 1, startCol = 1, noRows = 11, noColumns
= 50, create = FALSE)
saveWorkbook(wb, "format_lost.xlsx") # some of the formatting is lost (col I to
L, rows 1 to 11)
wb <- loadWorkbook("good_format.xlsx") #using cells formatting only (columns A
to L rows 1 to 10,000)
sh <- getSheets(wb)
s1 <- sh[[1]]
cb <- CellBlock(sheet = s1, startRow = 1, startCol = 1, noRows = 11, noColumns
= 50, create = FALSE)
saveWorkbook(wb, "format_kept.xlsx") # the formatting is kept
Original issue reported on code.google.com by adrian.d...@gmail.com on 13 Feb 2014 at 7:51
I still see it. If it helps I'm using Excel version 2010 with the following R
config:
sessionInfo()
R version 3.0.3 (2014-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xlsx_0.5.7 xlsxjars_0.6.0 rJava_0.9-6
loaded via a namespace (and not attached):
[1] tools_3.0.3
Original comment by benoit.h...@gmail.com on 4 Aug 2014 at 12:42
Original issue reported on code.google.com by
adrian.d...@gmail.com
on 13 Feb 2014 at 7:51Attachments:
The text was updated successfully, but these errors were encountered: