Published 2005-11-10 09:26:06

You know it is going to be one of those days when the lift to the office starts going up, even when you pushed the down button in the lobby..

The morning started with a heated discussion about proposing a video conferencing system to one of our clients. I had come down to two options, a polycom plug and play (hopefully) system, or using 2 iMac's with iChat. But one of my collegues suggested that we recommend a Windows box, with MSN or similar. I was addement, I will never recommend windows for anything as complex as that, the implications for support, securing it (as it needed to have a fixed IP), and knowing that the thing would be guarenteed to fail a good proportion of the times the end user wanted to do a conference. While I sounded alot like a anti-microsoft zealot, I've been burnt far to many times in recommending and installing Windows to even consider it as a reliable option. And it get's difficult arguing with someone who actually think's that OS X has viruses ;)

Anyway, that was just the start of the Microsoft crap for the day. Developers, Developers, Developers I hear them cry, well the day their software actually works as expected, I think they might actually attract enthusiastic developers.

The task for the day was to fix some code I had written to export data to excel. I had practically copy and pasted some code from one project to this one, to implement this process. (I think I've blogged about the concept before), basically you render a HTML table with the data you want to export (a preview), then you use a javascript library, to read the table and generate a gnumeric xml file. This get's sent to the server, that then runs ssconvert to output a beautifully formated excel file, (doing all the colour, background, font effects etc.)

Of course, this library had only be tested on Firefox (as most of the projects that it was used with where XUL based). So I had just said to the tester, does it work with IE?.. of course the answer came back .. NO!

Given the fact that the javascript code in the application followed W3C DOM standards, and did not do anything that amazing, I guess I was a little supprised. So out came vmware, and my nice sandboxed Windows 98. In all it took over 4 hours to solve this, and I guess it's time I regard as a waste of my life (like most times I have to use windows ;)

  • First indication of a problem was a little yellow triangle on the browser, pressing on it, told me error at line 0: download()
    This it turned out (from what I remember), was that for some reason, IE did not like a href="javascript:download()" as a link, and only when it was replaced with onclick, did it start working ok.
  • Next up was some message about object does not support that operation on line 134 of xyz.html.
    Well, looking at the HTML file, there was no javascript on that line!, it took me quite a while to realize, that the debugger can not handle included javascript files (and uses the line number from the original file) duh!!!, I had to copy all the javascript from the included files, into the main one just to debug it.
  • That bug turned out to be something as simple as this
    x = this.createXMLHttpRequest();
    if (x != false) {
    Since x was an object, it could not be checked against a boolean (even though this works perfectly on Firefox)
  • After getting those bugs fixed, the next was a unknown method on an object. which was basically
    document.getElementsByTagNameNS('*'',"rows");
    used to grab sections of the Gnumeric template file, much to my amazement (well less so by now), I realized that IE doesnt actually implement DOM!!! (or DOM3 AFAIK) properly...
  • At this point I gave up thinking that IE would ever work (or was worth supporting) for my nice exporter. So I started thinking just doing a HTML table to CSV importer, using pretty much the same concept. I however ended up spending a good half hour puzzling over a "Can not download" message, as soon as I added the Content-type header to the output. The kludge workaround for which is actually mentioned on the PHP manual comments.
All in all not one of my better days....
Mentioned By:
google.com : november (105 referals)
google.com : april (61 referals)
www.planet-php.net : Planet PHP (48 referals)
google.com : microsoft crap (18 referals)
google.com : gnumeric win98 (17 referals)
www.phpxperts.com : The StoryTeller (12 referals)
planet.debian.org.hk : Debian HK : Debian @ Hong Kong (10 referals)
google.com : gnumeric windows 98 (8 referals)
rss.artis-tic.com : RssOperator for xmpp:talou@timot.net (7 referals)
google.com : microsoft is crap (7 referals)
www.midgard-project.org : Midgard CMS - The Midgard Community (6 referals)
google.com : PHP microsoft (6 referals)
www.phpn.org : Microsoft, always delivers... crap... (5 referals)
google.com : alan 48 excel schematic (5 referals)
google.com : microsoft (4 referals)
www.midgard-project.org : Midgard CMS - MidCOM 2.4.0 released (in News) (3 referals)
www.midgard-project.org : Midgard CMS - Planet Midgard (3 referals)
timvw.madoka.be : Tim Van Wassenhove » Blogmarks (3 referals)
google.com : ALWAYS (3 referals)
google.com : crap (3 referals)

Comments

Cool, You are correct 100%
Not only that, M$ also delivers some worthless solutions. Can you remember the security flaws exposed by IE?

I really dont beleieve in M$, *nix rocks, always.
#0 - Hasin ( Link) on 2005-11-10 14:58:15 Delete Comment
IE
Well, MsIE has a mostly-working DOM1 support. definitely not DOM-3
#1 - Alexey Zakhlestine ( Link) on 2005-11-10 15:48:17 Delete Comment
Copy/Paste tables
What I recommend is to select the content of the HTML table, then paste it in Excel. The result will be formatted like in the table, without the styles. That's the quick and dirty way :)
#2 - Bertrand Mansion ( Link) on 2005-11-10 22:24:55 Delete Comment
PEAR::Spreadsheet_Excel_Writer
Try using <a href="http://pear.php.net/package/Spreadsheet_Excel_Writer">PEAR::Spreadsheet_Excel_Writer</a> to generate your spreadsheet files. Works well for what I've used it for on past projects. :)
#3 - Jacques Marneweck ( Link) on 2005-11-11 01:41:49 Delete Comment
Windows 98?!?
You mention you are using windows 98. Which version of IE are you using then? The Dom compliance was *especially* poor in some (if not all) versions of 5.x and you really need the latest version 6 to have the best chance. That is until we can get *everyone* to use FireFox :)
#4 - SnowTiger ( Link) on 2005-11-27 19:42:18 Delete Comment

Add Your Comment

Follow us on