PHP_XLSXWriter_plus icon indicating copy to clipboard operation
PHP_XLSXWriter_plus copied to clipboard

Styles corrupted in excel 2013

Open smiffy6969 opened this issue 10 years ago • 6 comments

Opening in excel 2013 the popup error shows...

We found a problem with some content in '....xlsx'. Do you want us to try to recover...

Problem is recovering the file strips all formatting, which sort of negates the reason for using this fork over XLSXWriter.

Any ideas, more than capable of fixing for you if you point me in the right direction.

ta

smiffy6969 avatar Nov 12 '14 12:11 smiffy6969

ohh forgot to mention, opens fine in libre office calc :\

smiffy6969 avatar Nov 12 '14 12:11 smiffy6969

line 288 fwrite($fd, '<fasmily val="2"/>') should be fwrite($fd, '<family val="2"/>')

smiffy6969 avatar Nov 12 '14 13:11 smiffy6969

lines 272 to 277 should be

if (isset($style['font']['name']) && !empty($style['font']['name'])) $this->fontName = $style['font']['name'];
if (isset($style['font']['size']) && !empty($style['font']['size'])) $this->fontSize = $style['font']['size'];
if (isset($style['font']['color']) && !empty($style['font']['color'])) $this->fontColor = $style['font']['color'];
if (isset($style['font']['bold']) && !empty($style['font']['bold'])) $this->fontStyles .= '<b/>';
if (isset($style['font']['italic']) && !empty($style['font']['italic'])) $this->fontStyles .= '<i/>';
if (isset($style['font']['underline']) && !empty($style['font']['underline'])) $this->fontStyles .= '<u/>';

smiffy6969 avatar Nov 12 '14 13:11 smiffy6969

line 287 should be

if ($this->fontName) fwrite($fd, '      <name val="'.$this->fontName.'"/>');

smiffy6969 avatar Nov 12 '14 13:11 smiffy6969

This now compiles and opens n libre office AND excel 2013

smiffy6969 avatar Nov 12 '14 13:11 smiffy6969

Would be nice to get these changes in place, this is an awesome tool and a nice fork giving needed features!

smiffy6969 avatar Nov 12 '14 13:11 smiffy6969