tests/testthat/helper-format.R

read_data_format <- function(cell) {
  cs <- getCellStyle(cell)
  
  rJava::.jcall(cs,'S','getDataFormatString')
}

read_fill_foreground <- function(cell) {
  cs <- getCellStyle(cell)
  
  col <- rJava::.jcall(cs,'Lorg/apache/poi/xssf/usermodel/XSSFColor;','getFillForegroundXSSFColor')
  
  if (!is.null(col)) {
    barr <- rJava::.jcall(col,'[B','getRgb')
    return(paste(as.character(barr),collapse=''))
  } else {
    return(NULL)
  }
}

Try the xlsx package in your browser

Any scripts or data that you put into this service are public.

xlsx documentation built on Nov. 10, 2020, 3:52 p.m.