| PivotOpenXlsxRenderer {pivottabler} | R Documentation |
R6 class that renders a pivot table into an Excel worksheet.
Description
The 'PivotOpenXlsxRenderer' class creates a representation of a pivot table in an Excel file using the 'openxlsx' package. See the "Excel Export" vignette for details and examples.
Format
R6Class object.
Methods
Public methods
Method new()
Create a new 'PivotOpenXlsxRenderer' object.
Usage
PivotOpenXlsxRenderer$new(parentPivot)
Arguments
parentPivotThe pivot table that this 'PivotOpenXlsxRenderer' instance belongs to.
Returns
A new 'PivotOpenXlsxRenderer' object. An internal method used when rendering a pivot table to HTML. Clear the IsRendered flags that exist on the 'PivotDataGroup' class.
Method clearIsRenderedFlags()
Usage
PivotOpenXlsxRenderer$clearIsRenderedFlags()
Returns
No return value.
Method writeToCell()
Writes a value to a cell and applies styling as needed.
Usage
PivotOpenXlsxRenderer$writeToCell( wb = NULL, wsName = NULL, rowNumber = NULL, columnNumber = NULL, value = NULL, applyStyles = TRUE, baseStyleName = NULL, style = NULL, mapFromCss = TRUE, mergeRows = NULL, mergeColumns = NULL )
Arguments
wbA 'Workbook' object representing the Excel file being written to.
wsNameA character value specifying the name of the worksheet to write to.
rowNumberAn integer value specifying the row number of the cell to write to.
columnNumberAn integer value specifying the column number of the cell to write to.
valueThe value to write into the cell.
applyStylesDefault 'TRUE' to write styling information to the cell.
baseStyleNameA character value specifying a named style defined in the pivot table.
styleA 'PivotStyle' object containing CSS style declarations to override the base style.
mapFromCssDefault 'TRUE' to automatically convert CSS style declarations to their Excel equivalents.
mergeRowsAn integer vector specifying the row extent of a merged cell.
mergeColumnsAn integer vector specifying the column extent of a merged cell.
Returns
No return value.
Method writeToWorksheet()
Write the pivot table into the specified workbook and worksheet at the specified row-column location.
Usage
PivotOpenXlsxRenderer$writeToWorksheet( wb = NULL, wsName = NULL, topRowNumber = NULL, leftMostColumnNumber = NULL, outputHeadingsAs = "formattedValueAsText", outputValuesAs = "rawValue", applyStyles = TRUE, mapStylesFromCSS = TRUE, exportOptions = NULL, showRowGroupHeaders = FALSE )
Arguments
wbA 'Workbook' object representing the Excel file being written to.
wsNameA character value specifying the name of the worksheet to write to.
topRowNumberAn integer value specifying the row number in the Excel worksheet to write the pivot table.
leftMostColumnNumberAn integer value specifying the column number in the Excel worksheet to write the pivot table.
outputHeadingsAsMust be one of "rawValue", "formattedValueAsText" (default) or "formattedValueAsNumber" to specify how data groups are written into the Excel sheet.
outputValuesAsMust be one of "rawValue" (default), "formattedValueAsText" or "formattedValueAsNumber" to specify how cell values are written into the Excel sheet.
applyStylesDefault 'TRUE' to write styling information to the cell.
mapStylesFromCSSDefault 'TRUE' to automatically convert CSS style declarations to their Excel equivalents.
exportOptionsA list of additional export options - see the "A1. Appendix" for details.
showRowGroupHeadersDefault 'FALSE', specify 'TRUE' to write row group headers.
Returns
No return value.
Method clone()
The objects of this class are cloneable with this method.
Usage
PivotOpenXlsxRenderer$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.