1
votes

I'm exporting a report from Oracle service cloud database to Excel. Everything is working as expected but when there is a bullet points it show as a weird Characters. Filling the report is being done by a form which insert into the database and then I'm exporting this report to Excel using PHPExcel and Excel5.php class. When I use the HTML.php class I see the bullet point with no problem but then I lose some of Excel formatting. Below is my code

header('Content-Type: application/xls');
    header('Content-Disposition: attachment;filename="' . $fileName . '.xls"');
    header('Cache-Control: max-age=0');

    header('Cache-Control: max-age=1');

    header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 
    header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
    header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
    header ('Pragma: public'); // HTTP/1.0
    $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
    $objWriter->save('php://output');

I did research this issue and some advice to make all data type as a string but that did not make any changes. $objPHPExcel->getActiveSheet()->setCellValueExplicit('A1','0987', PHPExcel_Cell_DataType::TYPE_STRING);

Used the UTF-8 still did not change anything.

Can you please help?

1

1 Answers

0
votes

So I like to share my solution on this. I'm still unable to export bullet points but I was able to convert them to another character.

$colValue = htmlentities($colValue);
$colValue = html_entity_decode($colValue,ENT_QUOTES,'UTF-8');
$colValue = str_replace("•",":-","$colValue");