setFillBackgroundColor-methods | R Documentation |
Specifies the fill background color for a cellstyle
.
## S4 method for signature 'cellstyle,numeric'
setFillBackgroundColor(object,color)
object |
The |
color |
The fill background color to use for the |
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
workbook
, cellstyle
, setCellStyle
,
setStyleAction
, XLC
## Not run:
# Load workbook (create if not existing)
wb <- loadWorkbook("setFillBackgroundColor.xlsx", create = TRUE)
# Create a worksheet
createSheet(wb, name = "cellstyles")
# Create a custom anonymous cell style
cs <- createCellStyle(wb)
# Specify the fill background color for the cell style created above
setFillBackgroundColor(cs, color = XLC$"COLOR.CORNFLOWER_BLUE")
# Specify the fill foreground color
setFillForegroundColor(cs, color = XLC$"COLOR.YELLOW")
# Specify the fill pattern
setFillPattern(cs, fill = XLC$"FILL.BIG_SPOTS")
# Set the cell style created above for the top left cell (A1) in the
# 'cellstyles' worksheet
setCellStyle(wb, sheet = "cellstyles", row = 1, col = 1, cellstyle = cs)
# Save the workbook
saveWorkbook(wb)
# clean up
file.remove("setFillBackgroundColor.xlsx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.