0
votes

I design a *.xlsx per MS-Excel, format numeric like

#'##0.00_

Thousands-char is ' not , !

Per PHPExcel open the xlsx and insert some values (unformatted).

Save as a new file:

 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
 $objWriter->save($Filename);

When I open these file in Excel, is looks very good, right format.

But when I output in HTML there I can see the thousands , again.

PHPExcel_Shared_Font::setAutoSizeMethod(PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
echo PHPExcel_HTML_bereinigen($objWriter->generateHTMLHeader(true));
$objWriter->setSheetIndex(1); // only second Sheet
echo $objWriter->generateSheetData();

How can I force to format all numbers by ' or without an thousands?

Version PHPExcel_1.8.0 (I have hundreds of files with hundreds of cells)

Thank you so much!

1

1 Answers

0
votes

If you want without a thousands separator, then change your format mask to:

###0.00_

Otherwise, use

#,##0.00_

and set the thousands separator using

PHPExcel_Shared_String::setThousandsSeparator("'");