R/TableOpenXlsxStyles.R
TableOpenXlsxStyles.Rd
The `TableOpenXlsxStyles` class stores a collection of `TableTableOpenXlsx` style objects.
R6Class
object.
count
The number of styles in the collection.
styles
A list of `TableOpenXlsxStyle` objects that comprise the collection.
new()
Create a new `TableOpenXlsxStyles` object.
TableOpenXlsxStyles$new(parentTable)
parentTable
Owning table.
No return value.
clearStyles()
Clear the collection removing all styles.
TableOpenXlsxStyles$clearStyles()
No return value.
findNamedStyle()
Find a style in the collection matching the specified base style name.
TableOpenXlsxStyles$findNamedStyle(baseStyleName)
baseStyleName
The style name to find.
A `TableTableOpenXlsx` object that is the style matching the specified base style name or `NULL` otherwise.
findOrAddStyle()
Find a style in the collection matching the specified base style name and style properties. If there is no matching style, then optionally add a new style.
TableOpenXlsxStyles$findOrAddStyle( action = "findOrAdd", baseStyleName = NULL, isBaseStyle = NULL, style = NULL, mapFromCss = TRUE )
action
The action to carry out. Must be one of "find", "add" or "findOrAdd" (default).
baseStyleName
The style name to find/add.
isBaseStyle
Is the style to be found/added a base style?
style
A `TableStyle` object specifying style properties to be found/added.
mapFromCss
`TRUE` (default) to map the basictabler CSS styles to corresponding Excel styles, `FALSE` to apply only the specified xl styles.
A `TableTableOpenXlsx` object that is the style matching the specified base style name or `NULL` otherwise.
addNamedStyles()
Populate the OpenXlsx styles based on the styles defined in the table.
TableOpenXlsxStyles$addNamedStyles(mapFromCss = TRUE)
mapFromCss
`TRUE` (default) to map the basictabler CSS styles to corresponding Excel styles, `FALSE` to apply only the specified xl styles.
No return value.
asList()
Return the contents of this object as a list for debugging.
TableOpenXlsxStyles$asList()
A list of various object properties.
asJSON()
Return the contents of this object as JSON for debugging.
TableOpenXlsxStyles$asJSON()
A JSON representation of various object properties.
asString()
Return the contents of this object as a string for debugging.
TableOpenXlsxStyles$asString(seperator = ", ")
seperator
Delimiter used to combine multiple values into a string.
A character representation of various object properties.
clone()
The objects of this class are cloneable with this method.
TableOpenXlsxStyles$clone(deep = FALSE)
deep
Whether to make a deep clone.
# This class should not be used by end users. It is an internal class # created only by the BasicTable class. It is used when rendering to Excel. library(basictabler) tbl <- qtbl(data.frame(a=1:2, b=3:4)) library(openxlsx) wb <- createWorkbook(creator = Sys.getenv("USERNAME")) addWorksheet(wb, "Data") tbl$writeToExcelWorksheet(wb=wb, wsName="Data", topRowNumber=1, leftMostColumnNumber=1, applyStyles=TRUE, mapStylesFromCSS=TRUE) # Use saveWorkbook() to save the Excel file.