R/PivotOpenXlsxStyles.R
PivotOpenXlsxStyles.Rd
The `PivotOpenXlsxStyles` class stores a collection of `PivotOpenXlsxStyle` style objects.
R6Class
object.
count
The number of `PivotOpenXlsxStyle` objects in this `PivotOpenXlsxStyles` collection.
styles
A list containing the `PivotOpenXlsxStyle` objects in this `PivotOpenXlsxStyles` collection.
findOrAddStyle()
Find an existing openxlsx style, add a new openxlsx style matching a base style and/or existing `PivotStyle` object.
PivotOpenXlsxStyles$findOrAddStyle(
action = "findOrAdd",
baseStyleName = NULL,
isBaseStyle = NULL,
style = NULL,
mapFromCss = TRUE
)
action
Must be one of "find" (to search for an existing style), "add" (to add a new style) or "findOrAdd" (default, to first search for an existing style, and if no match is found then add a new style)
baseStyleName
The name of the base style to find.
isBaseStyle
`TRUE` if the style being sought is a base style.
style
An existing `PivotStyle` object.
mapFromCss
Default `TRUE`, to create a new `PivotOpenXlsxStyle` by mapping from CSS style declarations.
This function is used in two different ways: (1) When adding base styles (i.e. named styles in the pivot table) to this `PivotOpenXlsxStyles` collection: In this case, `baseStyleName` is the name of the style and `isBaseStyle=TRUE` (so matching is by name only) and `style` is the `PivotStyle` object for the base style. (2) When finding styles that have been applied to individual cells using the `PivotStyle` object that is attached to each cell: In this case, `baseStyleName` may or may not be present, `isBaseStyle=FALSE` and `style` is the `PivotStyle` object from the cell.
addNamedStyles()
Populate the OpenXlsx styles based on the styles defined in the pivot table.
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.