FacturaScripts

XLSExport extends XLSExport
in package

Class created by Core/Internal/PluginsDeploy

Table of Contents

Constants

LIST_LIMIT  : mixed = 5000

Properties

$numSheets  : int
$sheetNames  : array<string|int, mixed>
$writer  : XLSXWriter

Methods

addBusinessDocPage()  : bool
Adds a new page with the document data.
addListModelPage()  : bool
Adds a new page with a table listing all models data.
addModelPage()  : bool
Adds a new page with the model data.
addTablePage()  : bool
Adds a new page with the table.
getDoc()  : string
Return the full document.
newDoc()  : mixed
Blank document.
setOrientation()  : mixed
Sets default orientation.
show()  : mixed
Set headers and output document content to response.
escapeSpreadsheetFormula()  : string
escapeSpreadsheetFormulaRow()  : array<string|int, mixed>
getColumnAlignments()  : array<string|int, mixed>
getColumnHeaders()  : array<string|int, mixed>
Devuelve las cabeceras a partir de las columnas de la vista, con el título traducido y el tipo de celda según el widget, para que los campos numéricos y moneda se puedan procesar en la hoja de cálculo.
getColumnTitles()  : array<string|int, mixed>
getColumnWidgets()  : array<string|int, mixed>
getCursorData()  : array<string|int, mixed>
getCursorRawData()  : array<string|int, mixed>
getCursorValue()  : mixed
Devuelve el valor de una celda. En los formatos procesables (CSV, XLS) los campos numéricos, moneda, fecha y checkbox se vuelcan en crudo o normalizados para poder procesarlos; el resto usa el texto formateado del widget.
getDocumentFormat()  : FormatoDocumento
getFileName()  : string
getModelColumnsData()  : array<string|int, mixed>
getModelFields()  : array<string|int, mixed>
getModelHeaders()  : array<string|int, mixed>
getRows()  : array<string|int, mixed>
Devuelve las filas de datos del cursor. Si hay columnas de la vista, usa sus widgets para formatear los valores, igual que PDFExport.
getSheetName()  : string
Devuelve un nombre de hoja único y válido para Excel, que limita el nombre a 31 caracteres.
setFileName()  : mixed

Constants

Properties

$sheetNames

protected array<string|int, mixed> $sheetNames = []

Methods

addListModelPage()

Adds a new page with a table listing all models data.

public addListModelPage(ModelClass $model, array<string|int, Where> $where, array<string|int, mixed> $order, int $offset, array<string|int, mixed> $columns[, string $title = '' ]) : bool
Parameters
$model : ModelClass
$where : array<string|int, Where>
$order : array<string|int, mixed>
$offset : int
$columns : array<string|int, mixed>
$title : string = ''
Return values
bool

addModelPage()

Adds a new page with the model data.

public addModelPage(ModelClass $model, array<string|int, mixed> $columns[, string $title = '' ]) : bool
Parameters
$model : ModelClass
$columns : array<string|int, mixed>
$title : string = ''
Return values
bool

addTablePage()

Adds a new page with the table.

public addTablePage(array<string|int, mixed> $headers, array<string|int, mixed> $rows[, array<string|int, mixed> $options = [] ][, string $title = '' ]) : bool
Parameters
$headers : array<string|int, mixed>
$rows : array<string|int, mixed>
$options : array<string|int, mixed> = []
$title : string = ''
Return values
bool

getDoc()

Return the full document.

public getDoc() : string
Return values
string

newDoc()

Blank document.

public newDoc(string $title, int $idformat, string $langcode) : mixed
Parameters
$title : string
$idformat : int
$langcode : string

setOrientation()

Sets default orientation.

public setOrientation(string $orientation) : mixed
Parameters
$orientation : string

show()

Set headers and output document content to response.

public show(Response &$response) : mixed
Parameters
$response : Response

escapeSpreadsheetFormula()

protected escapeSpreadsheetFormula(string $value) : string
Parameters
$value : string
Return values
string

escapeSpreadsheetFormulaRow()

protected escapeSpreadsheetFormulaRow(array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
$row : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnAlignments()

protected getColumnAlignments(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnHeaders()

Devuelve las cabeceras a partir de las columnas de la vista, con el título traducido y el tipo de celda según el widget, para que los campos numéricos y moneda se puedan procesar en la hoja de cálculo.

protected getColumnHeaders(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnTitles()

protected getColumnTitles(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnWidgets()

protected getColumnWidgets(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getCursorData()

protected getCursorData(array<string|int, ModelClass> $cursor, array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$cursor : array<string|int, ModelClass>
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getCursorRawData()

protected getCursorRawData(array<string|int, mixed> $cursor[, array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>
Parameters
$cursor : array<string|int, mixed>
$fields : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getCursorValue()

Devuelve el valor de una celda. En los formatos procesables (CSV, XLS) los campos numéricos, moneda, fecha y checkbox se vuelcan en crudo o normalizados para poder procesarlos; el resto usa el texto formateado del widget.

protected getCursorValue(BaseWidget $widget, ModelClass $row) : mixed
Parameters
$widget : BaseWidget
$row : ModelClass

getFileName()

protected getFileName() : string
Return values
string

getModelColumnsData()

protected getModelColumnsData(mixed $model, array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$model : mixed
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getModelFields()

protected getModelFields(ModelClass $model) : array<string|int, mixed>
Parameters
$model : ModelClass
Return values
array<string|int, mixed>

getModelHeaders()

protected getModelHeaders(ModelClass $model) : array<string|int, mixed>
Parameters
$model : ModelClass
Return values
array<string|int, mixed>

getRows()

Devuelve las filas de datos del cursor. Si hay columnas de la vista, usa sus widgets para formatear los valores, igual que PDFExport.

protected getRows(array<string|int, ModelClass> $cursor, array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$cursor : array<string|int, ModelClass>
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getSheetName()

Devuelve un nombre de hoja único y válido para Excel, que limita el nombre a 31 caracteres.

protected getSheetName(string $title) : string
Parameters
$title : string
Return values
string

setFileName()

protected setFileName(string $name) : mixed
Parameters
$name : string
On this page

Search results