class Ods extends BaseWriter (View source)

Properties

protected bool $includeCharts Write charts that are defined in the workbook? Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object;. from BaseWriter
protected bool $preCalculateFormulas Pre-calculate formulas Forces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file. from BaseWriter

Methods

bool
getIncludeCharts()

Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object.

setIncludeCharts(bool $pValue)

Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.

bool
getPreCalculateFormulas()

Get Pre-Calculate Formulas flag If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.

setPreCalculateFormulas(bool $pValue)

Set Pre-Calculate Formulas Set to true (the default) to advise the Writer to calculate all formulae on save Set to false to prevent precalculation of formulae on save.

bool
getUseDiskCaching()

Get use disk caching where possible?

setUseDiskCaching(bool $pValue, string $pDirectory = null)

Set use disk caching where possible?

string
getDiskCachingDirectory()

Get disk caching directory.

__construct(Spreadsheet $spreadsheet)

Create a new Ods.

null|WriterPart
getWriterPart(string $pPartName)

Get writer part.

save(string $pFilename)

Save PhpSpreadsheet to file.

getSpreadsheet()

Get Spreadsheet object.

Ods
setSpreadsheet(Spreadsheet $spreadsheet)

Set Spreadsheet object.

Details

bool getIncludeCharts()

Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object.

If false (the default) it will ignore any charts defined in the PhpSpreadsheet object.

Return Value

bool

IWriter setIncludeCharts(bool $pValue)

Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.

Set to false (the default) to ignore charts.

Parameters

bool $pValue

Return Value

IWriter

bool getPreCalculateFormulas()

Get Pre-Calculate Formulas flag If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.

Return Value

bool

IWriter setPreCalculateFormulas(bool $pValue)

Set Pre-Calculate Formulas Set to true (the default) to advise the Writer to calculate all formulae on save Set to false to prevent precalculation of formulae on save.

Parameters

bool $pValue Pre-Calculate Formulas?

Return Value

IWriter

bool getUseDiskCaching()

Get use disk caching where possible?

Return Value

bool

IWriter setUseDiskCaching(bool $pValue, string $pDirectory = null)

Set use disk caching where possible?

Parameters

bool $pValue
string $pDirectory Disk caching directory

Return Value

IWriter

Exceptions

Exception when directory does not exist

string getDiskCachingDirectory()

Get disk caching directory.

Return Value

string

__construct(Spreadsheet $spreadsheet)

Create a new Ods.

Parameters

Spreadsheet $spreadsheet

null|WriterPart getWriterPart(string $pPartName)

Get writer part.

Parameters

string $pPartName Writer part name

Return Value

null|WriterPart

save(string $pFilename)

Save PhpSpreadsheet to file.

Parameters

string $pFilename Name of the file to save

Exceptions

Exception

Spreadsheet getSpreadsheet()

Get Spreadsheet object.

Return Value

Spreadsheet

Exceptions

Exception

Ods setSpreadsheet(Spreadsheet $spreadsheet)

Set Spreadsheet object.

Parameters

Spreadsheet $spreadsheet PhpSpreadsheet object

Return Value

Ods