Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: Trouble with masks while exporting XlXS to HTML

$
0
0
Hello,

I´m trying to use the PHPExcel to convert Excel Files to HTML, the Excel file have some masks (like number format, currency, dates, etc.) but when i try to export it to HTML, it show the field without his mask.

EX:
  in MS Excel the column show the date in Brazil format: "21/02/2016"
  in HTML the column show the date without mask:  "2016-02-12"
There's any way to convert to HTML with the masks?


Here is my Code:
$excelReader = new PHPExcel_Reader_Excel2007();
//Lê o arquivo excel
$excelFile   = $excelReader->load($file_location);
//Converte o arquivo para HTML
$excelWriterHtml = new PHPExcel_Writer_HTML($excelFile);
//Pega os dados HTML
$excelHtml   = $excelWriterHtml->generateHTMLHeader();
$excelHtml  .= '<style>' . utf8_decode($excelWriterHtml->generateStyles()) . '</style>';
$excelHtml  .= $excelWriterHtml->generateSheetData();
$excelHtml  .= $excelWriterHtml->generateHTMLFooter();
//echo or download the file after this code

Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>