R/PivotOpenXlsxRenderer.R
PivotOpenXlsxRenderer.RdThe `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.
R6Class object.
new()Create a new `PivotOpenXlsxRenderer` object.
PivotOpenXlsxRenderer$new(parentPivot)writeToCell()Writes a value to a cell and applies styling as needed.
PivotOpenXlsxRenderer$writeToCell(
wb = NULL,
wsName = NULL,
rowNumber = NULL,
columnNumber = NULL,
value = NULL,
applyStyles = TRUE,
baseStyleName = NULL,
style = NULL,
mapFromCss = TRUE,
mergeRows = NULL,
mergeColumns = NULL
)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.
writeToWorksheet()Write the pivot table into the specified workbook and worksheet at the specified row-column location.
PivotOpenXlsxRenderer$writeToWorksheet(
wb = NULL,
wsName = NULL,
topRowNumber = NULL,
leftMostColumnNumber = NULL,
outputHeadingsAs = "formattedValueAsText",
outputValuesAs = "rawValue",
applyStyles = TRUE,
mapStylesFromCSS = TRUE,
exportOptions = NULL,
showRowGroupHeaders = FALSE
)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.
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.