ExcelWorksheetWriter
in package
Worksheet writer compatibility shim.
Exposes the small subset of the legacy Spreadsheet_Excel_Writer_Worksheet API used by the statistics exporters (write/writeNumber/setColumn) and forwards the calls to a PhpSpreadsheet worksheet.
Like the legacy library, row and column indexes are zero-based.
Table of Contents
Properties
- $sheet : Worksheet
Methods
- __construct() : mixed
- setColumn() : void
- Set the width of a range of columns.
- write() : void
- Write a value to a cell. Values are written as text to preserve the legacy behaviour and to avoid spreadsheet formula injection from user-supplied content (a leading "=" would otherwise be treated as a formula).
- writeNumber() : void
- Write a numeric value to a cell.
- applyFormat() : void
- Apply an ExcelCellFormat to a single cell.
Properties
$sheet
private
Worksheet
$sheet
Methods
__construct()
public
__construct(Worksheet $sheet) : mixed
Parameters
- $sheet : Worksheet
setColumn()
Set the width of a range of columns.
public
setColumn(int $firstColumn, int $lastColumn, float|int $width) : void
Parameters
- $firstColumn : int
-
Zero-based index of the first column.
- $lastColumn : int
-
Zero-based index of the last column.
- $width : float|int
-
Column width.
write()
Write a value to a cell. Values are written as text to preserve the legacy behaviour and to avoid spreadsheet formula injection from user-supplied content (a leading "=" would otherwise be treated as a formula).
public
write(int $row, int $column, mixed $value[, ExcelCellFormat|null $format = null ]) : void
Parameters
- $row : int
-
Zero-based row index.
- $column : int
-
Zero-based column index.
- $value : mixed
- $format : ExcelCellFormat|null = null
writeNumber()
Write a numeric value to a cell.
public
writeNumber(int $row, int $column, float|int $value[, ExcelCellFormat|null $format = null ]) : void
Parameters
- $row : int
-
Zero-based row index.
- $column : int
-
Zero-based column index.
- $value : float|int
- $format : ExcelCellFormat|null = null
applyFormat()
Apply an ExcelCellFormat to a single cell.
private
applyFormat(int $row, int $column, ExcelCellFormat|null $format) : void
Parameters
- $row : int
- $column : int
- $format : ExcelCellFormat|null