\GridFieldExcelExportButton
Enhanced GridField export button that allows the list to be exported to: * Excel 2007, * Excel 5, * CSV
The button appears has a Split button exposing the 3 possible export format.
- Author: Firebrand <hello@firebrand.nz>
- License: MIT
Synopsis
class GridFieldExcelExportButton
implements
GridField_HTMLProvider,GridField_ActionProvider,GridField_URLHandler
{
- // members
- protected bool $useLabelsAsHeaders = NULL;
- protected $targetFragment;
- // methods
- public void __construct()
- public array getHTMLFragments()
- public void getActions()
- public void handleAction()
- public void getURLHandlers()
- public string handleXlsx()
- public string handleXls()
- public string handleCsv()
- protected string genericHandle()
- protected void setHeader()
- protected SS_list getItems()
- public GridFieldExcelExportButton setUseLabelsAsHeaders()
- public bool|null getUseLabelsAsHeaders()
Hierarchy
Implements
- GridField_HTMLProvider
- GridField_ActionProvider
- GridField_URLHandler
Members
protected
-
$targetFragment
Fragment to write the button to - $useLabelsAsHeaders
—
bool
Whatever to override the default $useFieldLabelsAsHeaders value for the DataFormatter.
Methods
protected
- genericHandle() — Generic Handle request that will return a Spread Sheet in the requested format
- getItems() — Helper function to extract the item list out of the GridField.
- setHeader() — Set the HTTP header to force a download and set the filename.
public
- __construct() — Instanciate GridFieldExcelExportButton.
- getActions()
- getHTMLFragments()
- getURLHandlers()
- getUseLabelsAsHeaders() — Return the value that will be assigned to the DataFormatter's UseFieldLabelsAsHeaders property
- handleAction()
- handleCsv() — Action to export the GridField list to an CSV file.
- handleXls() — Action to export the GridField list to an Excel 5 file.
- handleXlsx() — Action to export the GridField list to an Excel 2007 file.
- setUseLabelsAsHeaders() — Set the DataFormatter's UseFieldLabelsAsHeaders property