saveXlsxAndDownload

saveXlsxAndDownload

BASIC / ADVANCED / PREMIUM

Generates and downloads the Excel spreadsheet.

Description
public saveXlsxAndDownload($fileName, $removeAfterDownload = false)
Parameters

fileName

File name and path of the new XLSX file to be downloaded.

removeAfterDownload

Removes the file after the download dialog opens.

options

The possible keys and values of this array are:

Key Type Description
removeCalcChain bool if true, remove calcChain file from the XLSX. MS Excel regenerates it automatically. Default as false.
Exceptions

The license is not valid.

The XSLX can't be saved.

Code samples

Example #1

Release notes
  • phpxlsx 4.0:
    • removeCalcChain option.
  • phpxlsx 1.0:
    • new method.