[thelist] PHP .xls export

Luther, Ron Ron.Luther at hp.com
Mon Feb 27 08:26:52 CST 2006


Matt Warden suggested:

>>Yes, I am 99% sure you can use an HTML table and it will import 
>>correctly into Excel.


Hi Matt,

Just adding a caveat here because we ran into some issues with this 
technique recently.

I think it works *at least* 99% of the time - if you are using 
it to export 'small' files.  Seems to work swell.

Unfortunately, two issues come up when you start playing with 
'big' files:

(1) This technique generates ginormous export file sizes.

(2) The formatting can get flaky on you.  (Date formats change 
midway through the file. Numbers become text. That kind of thing.)

We were able to replicate the problem on a number of machines, but 
we weren't able to isolate a root cause.  Records that seemed to 
trigger the format flakiness in the 'big' exports were handled with 
no problems when exported in a 'smaller' test case.  They were 
also handled fine if you cut down the raw export file using a text 
editor to isolate a few records before and after the inflection 
point. It was weird.

I firmly believe it's an artifact of Excel being a 'smart' application, 
but there is a possibility that hardware memory issues, different revs 
of Excel at different patch levels and text fields starting with 
somewhat-special characters, (+, ., etc.), may have played a role 
as well.  <shrug />

Bottom line -- we had enough problems with this (and enough users 
wanting BIG file output) that I had to have my guys abandon 
this technique.  I haven't seen any problems with 'small' files, 
but when you start pushing this technique to the limit it starts 
flaking out.


HTH,

RonL.



More information about the thelist mailing list