Login   Register  
PHP Classes
elePHPant
Icontem

Some update ideas for SimpleXLSX package:

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Simple XLSX  >  All threads  >  Some update ideas for SimpleXLSX package:  >  (Un) Subscribe thread alerts  
Subject:Some update ideas for SimpleXLSX package:
Summary:Version 0.6.5: Update suggestions:
Messages:1
Author:Walter Acheson
Date:2013-06-24 17:16:29
 

  1. Some update ideas for SimpleXLSX package:   Reply  
Picture of Walter Acheson
Walter Acheson
2013-06-24 17:16:29
First off - Awesome package. Very insightful for me and beneficial for me in learning to read/write xlsx. Thank you. I've also enjoyed getting this most recent update.
background:
I use a custom script to write XLSX files, and I've reordered my sheets from whats initially done by MS. As a result, it breaks several pieces.
My idea involves changing how you figure out the "worksheet_id". My rId indexes dont match up with std MS.

Update suggestions:
in function SheetName(), changing line 137 from:
if ( $s->attributes('r',true)->id == 'rId'.$worksheet_id)
to:
if ( (string) $s['sheetId'] == $worksheet_id)


in function SheetNames(), changing line 149 from:
$result[ substr( $s->attributes('r',true)->id, 3) ] = (string) $s['name'];
to:
$result[(string) $s['sheetId'] ] = (string) $s['name'];


in function _parse, changing line 576 from:
$this->sheets[ str_replace( 'rId', '', (string) $workbookRelation['Id']) ] = $sheet;
to:
$this->sheets[ substr(basename($path),5,-4) ] = $sheet;


For this last change in _parse, I think theres a better solution, which would be parsing through the workbook sheets, and then matching them up with the sheet names:
foreach( $this->workbook->sheets->sheet as $s ) {
....
}
but I haven't had a chance to test that development out, to see where it would end up.
Thanks again for a good package.