function hook_phpexcel_export in PHPExcel 7.3
Same name and namespace in other branches
- 8.3 phpexcel.api.php \hook_phpexcel_export()
- 7.2 phpexcel.api.php \hook_phpexcel_export()
Implements hook_phpexcel_export().
Allows modules to interact with the exporting of data. This hook is invoked at different stages of the export, represented by the $op parameter.
Parameters
string $op: The current operation. Can either be "headers", "new sheet", "data", "pre cell" or "post cell".
array|string &$data: The data. Depends on the value of $op:
- "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.
- "new sheet": The $data parameter will contain the sheet ID. This is a new sheet and can be altered, if required, using the $phpexcel parameter.
- "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.
- "pre cell": The $data parameter contains the call value to be rendered. The value has not been added yet and can still be altered.
- "post cell": The $data parameter contains the call value that was rendered. This value cannot be altered anymore.
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. Depends on the value of $op:
- "headers" or "data": The $phpexcel parameter will contain the PHPExcel object.
- "new sheet", "pre cell" or "post cell": The $phpexcel parameter will contain the PHPExcel_Worksheet object.
array $options: The $options array passed to the phpexcel_export() function.
int $column: The column number. Only available when $op is "pre cell" or "post cell".
int $row: The row number. Only available when $op is "pre cell" or "post cell".
See also
Related topics
File
- ./
phpexcel.api.php, line 676 - Module API documentation.
Code
function hook_phpexcel_export($op, &$data, $phpexcel, $options, $column = NULL, $row = NULL) {
switch ($op) {
case 'headers':
break;
case 'new sheet':
break;
case 'data':
break;
case 'pre cell':
break;
case 'post cell':
break;
}
}