| PivotOpenXlsxStyle {pivottabler} | R Documentation |
R6 class that specifies Excel styling as used by the openxlsx package.
Description
The 'PivotOpenXlsxStyle' class specifies the styling for cells in an Excel worksheet.
Format
R6Class object.
Active bindings
baseStyleNameThe name of the base style in the pivot table.
isBaseStyle'TRUE' when this style is the equivalent of a named style in the pivot table, 'FALSE' if this style has additional settings over and above the base style of the same name.
fontNameThe name of the font (single font name, not a CSS style list).
fontSizeThe size of the font (units: point, 4-72).
bold'TRUE' if text is bold.
italic'TRUE' if text is italic.
underline'TRUE' if text is underlined.
strikethrough'TRUE' if text has a line through it.
superscript'TRUE' if text is small and raised.
subscript'TRUE' if text is small and lowered.
fillColorThe background colour for the cell (as a hex value, e.g. #00FF00).
textColorThe color of the text (as a hex value).
hAlignThe horizontal alignment of the text: left, center or right.
vAlignThe vertical alignment of the text: top, middle or bottom.
wrapText'TRUE' if the text is allowed to wrap onto multiple lines.
textRotationThe rotation angle of the text (0 to 359) or 255 for vertical.
indentHorizontal indentation of cell contents (0 to 250.).
borderAllA list (with elements style and color) specifying the border settings for all four sides of each cell at once.
borderLeftA list (with elements style and color) specifying the border settings for the left border of each cell.
borderRightA list (with elements style and color) specifying the border settings for the right border of each cell.
borderTopA list (with elements style and color) specifying the border settings for the top border of each cell.
borderBottomA list (with elements style and color) specifying the border settings for the bottom border of each cell.
valueFormatThe Excel formatting applied to the field value. One of the following values: GENERAL, NUMBER, CURRENCY, ACCOUNTING, DATE, LONGDATE, TIME, PERCENTAGE, FRACTION, SCIENTIFIC, TEXT, COMMA. Or for dates/datetimes, a combination of d, m, y. Or for numeric values, use a numeric format code such as 0.00, #,###.00, etc
minColumnWidthThe minimum width of this column (0 to 255).
minRowHeightThe minimum height of this row (0 to 400).
openxlsxStyleThe style object returned from 'openxlsx::createStyle()'.
Methods
Public methods
Method new()
Create a new 'PivotOpenXlsxStyle' object.
Usage
PivotOpenXlsxStyle$new( parentPivot, baseStyleName = NULL, isBaseStyle = NULL, fontName = NULL, fontSize = NULL, bold = NULL, italic = NULL, underline = NULL, strikethrough = NULL, superscript = NULL, subscript = NULL, fillColor = NULL, textColor = NULL, hAlign = NULL, vAlign = NULL, wrapText = NULL, textRotation = NULL, indent = NULL, borderAll = NULL, borderLeft = NULL, borderRight = NULL, borderTop = NULL, borderBottom = NULL, valueFormat = NULL, minColumnWidth = NULL, minRowHeight = NULL )
Arguments
parentPivotThe pivot table that this 'PivotOpenXlsxStyle' instance belongs to.
baseStyleNameThe name of the base style in the pivot table.
isBaseStyle'TRUE' when this style is the equivalent of a named style in the pivot table, 'FALSE' if this style has additional settings over and above the base style of the same name.
fontNameThe name of the font (single font name, not a CSS style list).
fontSizeThe size of the font (units: point, 4-72).
bold'TRUE' if text is bold.
italic'TRUE' if text is italic.
underline'TRUE' if text is underlined.
strikethrough'TRUE' if text has a line through it.
superscript'TRUE' if text is small and raised.
subscript'TRUE' if text is small and lowered.
fillColorThe background colour for the cell (as a hex value, e.g. #00FF00).
textColorThe color of the text (as a hex value).
hAlignThe horizontal alignment of the text: left, center or right.
vAlignThe vertical alignment of the text: top, middle or bottom.
wrapText'TRUE' if the text is allowed to wrap onto multiple lines.
textRotationThe rotation angle of the text (0 to 359) or 255 for vertical.
indentHorizontal indentation of cell contents (0 to 250.).
borderAllA list (with elements style and color) specifying the border settings for all four sides of each cell at once.
borderLeftA list (with elements style and color) specifying the border settings for the left border of each cell.
borderRightA list (with elements style and color) specifying the border settings for the right border of each cell.
borderTopA list (with elements style and color) specifying the border settings for the top border of each cell.
borderBottomA list (with elements style and color) specifying the border settings for the bottom border of each cell.
valueFormatThe Excel formatting applied to the field value. One of the following values: GENERAL, NUMBER, CURRENCY, ACCOUNTING, DATE, LONGDATE, TIME, PERCENTAGE, FRACTION, SCIENTIFIC, TEXT, COMMA. Or for dates/datetimes, a combination of d, m, y. Or for numeric values, use a numeric format code such as 0.00, #,###.00, etc
minColumnWidthThe minimum width of this column (0 to 255).
minRowHeightThe minimum height of this row (0 to 400).
Returns
A new 'PivotOpenXlsxStyle' object.
Method isBasicStyleNameMatch()
Test whether a style is a base style with the specified name.
Usage
PivotOpenXlsxStyle$isBasicStyleNameMatch(baseStyleName = NULL)
Arguments
baseStyleNameThe name of the style to match.
Returns
No return value.
Method isFullStyleDetailMatch()
Test whether a style has matching style attributes.
Usage
PivotOpenXlsxStyle$isFullStyleDetailMatch( baseStyleName = NULL, isBaseStyle = NULL, fontName = NULL, fontSize = NULL, bold = NULL, italic = NULL, underline = NULL, strikethrough = NULL, superscript = NULL, subscript = NULL, fillColor = NULL, textColor = NULL, hAlign = NULL, vAlign = NULL, wrapText = NULL, textRotation = NULL, indent = NULL, borderAll = NULL, borderLeft = NULL, borderRight = NULL, borderTop = NULL, borderBottom = NULL, valueFormat = NULL, minColumnWidth = NULL, minRowHeight = NULL )
Arguments
baseStyleNameThe name of the base style in the pivot table.
isBaseStyle'TRUE' when this style is the equivalent of a named style in the pivot table, 'FALSE' if this style has additional settings over and above the base style of the same name.
fontNameThe name of the font (single font name, not a CSS style list).
fontSizeThe size of the font (units: point, 4-72).
bold'TRUE' if text is bold.
italic'TRUE' if text is italic.
underline'TRUE' if text is underlined.
strikethrough'TRUE' if text has a line through it.
superscript'TRUE' if text is small and raised.
subscript'TRUE' if text is small and lowered.
fillColorThe background colour for the cell (as a hex value, e.g. #00FF00).
textColorThe color of the text (as a hex value).
hAlignThe horizontal alignment of the text: left, center or right.
vAlignThe vertical alignment of the text: top, middle or bottom.
wrapText'TRUE' if the text is allowed to wrap onto multiple lines.
textRotationThe rotation angle of the text (0 to 359) or 255 for vertical.
indentHorizontal indentation of cell contents (0 to 250.).
borderAllA list (with elements style and color) specifying the border settings for all four sides of each cell at once.
borderLeftA list (with elements style and color) specifying the border settings for the left border of each cell.
borderRightA list (with elements style and color) specifying the border settings for the right border of each cell.
borderTopA list (with elements style and color) specifying the border settings for the top border of each cell.
borderBottomA list (with elements style and color) specifying the border settings for the bottom border of each cell.
valueFormatThe Excel formatting applied to the field value. One of the following values: GENERAL, NUMBER, CURRENCY, ACCOUNTING, DATE, LONGDATE, TIME, PERCENTAGE, FRACTION, SCIENTIFIC, TEXT, COMMA. Or for dates/datetimes, a combination of d, m, y. Or for numeric values, use a numeric format code such as 0.00, #,###.00, etc
minColumnWidthThe minimum width of this column (0 to 255).
minRowHeightThe minimum height of this row (0 to 400).
Details
Base styles are compared on name only, otherwise the style attributes are compared.
Returns
No return value.
Method createOpenXslxStyle()
Create an 'openxlsx' style from this style definition.
Usage
PivotOpenXlsxStyle$createOpenXslxStyle()
Returns
No return value. Retrieve the style using the 'openxlsxStyle' property.
Method asList()
Return the contents of this object as a list for debugging.
Usage
PivotOpenXlsxStyle$asList()
Returns
A list of various object properties.
Method asJSON()
Return the contents of this object as JSON for debugging.
Usage
PivotOpenXlsxStyle$asJSON()
Returns
A JSON representation of various object properties.
Method asString()
Return a representation of this object as a character value.
Usage
PivotOpenXlsxStyle$asString()
Returns
A character summary of various object properties.
Method clone()
The objects of this class are cloneable with this method.
Usage
PivotOpenXlsxStyle$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
# PivotOpenXlsxStyle objects are created by the PivotOpenXlsxRenderer class.
# See that class for details.