You are here

function hook_phpexcel_export in PHPExcel 7.2

Same name and namespace in other branches
  1. 8.3 phpexcel.api.php \hook_phpexcel_export()
  2. 7.3 phpexcel.api.php \hook_phpexcel_export()

Export

Parameters

string $op: The current operation

array|string &$data: The data. Depends on the operation. See documentation below for more information

PHPExcel|PHPExcel_Worksheet &$phpexcel: The current object used. Can either be a PHPExcel object when working with the excel file in general or a PHPExcel_Worksheet object when iterating through the worksheets.

array $options: The options for the phpexcel module

int $column: (optional) the column number

int $row: (optional) the row number

File

./phpexcel.api.php, line 30
Provide documentation to phpexcel hooks.

Code

function hook_phpexcel_export($op, &$data, &$phpexcel, $options, $column = NULL, $row = NULL) {
  switch ($op) {
    case 'headers':

      /**
       * The $data parameter will contain the headers in array form. The headers
       * have not been added to the document yet and can be altered at this
       * point.
       *
       * The $phpexcel parameter will contain the PHPExcel object.
       */
      break;
    case 'new sheet':

      /**
       * The $data parameter will contain the sheet ID. This is a new sheet and
       * can be altered.
       *
       * The $phpexcel parameter will contain the PHPExcel_Worksheet object.
       */
      break;
    case 'data':

      /**
       * The $data parameter contains all the data to be exported as a
       * 3-dimensional array. The data has not been exported yet and can be
       * altered at this point.
       *
       * The $phpexcel parameter contains the PHPExcel object
       */
      break;
    case 'pre cell':

      /**
       * The $data parameter contains the call value to be rendered. The value
       * has not been added yet and can still be altered.
       *
       * The $phpexcel parameter contains the PHPExcel_Worksheet object.
       *
       * The $column and $row parameters are set.
       */
      break;
    case 'post cell':

      /**
       * The $data parameter contains the call value that was rendered. This
       * value can not be altered anymore.
       *
       * The $phpexcel parameter contains the PHPExcel_Worksheet object.
       *
       * The $column and $row parameters are set.
       */
      break;
  }
}