phpexcel – on_render_excel

Questionsphpexcel – on_render_excel
Caroline asked 3 years ago

I want to change a data in a cell on export excel. But the event does not appear to occur. My php version is 5.3.3. The export take the filename only. It's my php version? thank!

$grid["export"] = array("format"=>"xls", "filename"=>"my-file", "heading"=>"Export to Excel Test", "range" => "filtered");
$e["on_render_excel"] = array("custom_export", null, false);

// custom on_export callback function
function custom_export($param)
$objPHPExcel = $param["phpexcel"];
$arr = $param["data"];

// column formatting using phpexcel
$cell = $r+1;
$data = 'Client: '.$arr[$r]["id"];


3 Answers
Abu Ghufran answered 3 years ago

Perhaps, you need to set 3rd param to true.

$e["on_render_excel"] = array("custom_export", null, true);

This will continue default export operation after you function.
As your function does not complete export code, it should be true.

Caroline answered 3 years ago

I try with "true" and nothing change. I received a excel file but the data of column C is not change.

Abu Ghufran answered 3 years ago

You can then make 3rd param to false, and then put complete implementation inside function.

Your Answer

12 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!