The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

best way of populating a complex spreadsheet from web?

We have a web application which should output a complex MS Excel spreadsheet (including pictures). What is the best way to do it?
Thursday, February 24, 2005
Ive heard tell that a shotgun to the head is pretty good, OTOH Ive always felt that the surest way is just to leap off a suitably high chance then of accidentally not killing yourself.  <g> ..or of changing your mind at the very last minute of course...

oh, sorry...I may have misunderstood...

ok, if you actually want to make a serious attempt before giving up, you could try using the office automation stuff in VB, basically Id make a wee standalone server that you would fire off the data too, and that would then use the excel automation stuff that comes builtin to put everything together.

but, frankly, if the excel spreadsheet you want to create *is* in fact at all complex, you will save yourself an awful lot of pain by ending it all now....
Thursday, February 24, 2005
I have two ways by now:
 1. Save the template as XML/HTML. Insert values the backend, output with "Content-type: application/x-ms-excel" (or something alike). Works for simple spreadsheets, Excel loads them as native. Not sure about embedded images.
 2. Run Excel on background, use automation to open and populate the template, save, ship. The problem is: we are on RedHat. But we are in-house, so I could create a .NET downloadble app, which will do it for me on the client side. What you think?
Thursday, February 24, 2005
There is a Perl module that can read/write Excel sheets. Allegedly. I couldn't get it to work, myself, so I just used text files in the end.

Thursday, February 24, 2005
There's POI which can create Excel documents, it's a Java thing though.
Thursday, February 24, 2005
We use WebSpeed + Progress 4GL, but raw C will do. Any libs?
Thursday, February 24, 2005
Create the Excel file on the server.

FTP it back to the client (may need a button on the web page).
Thursday, February 24, 2005

anything I could create Excel file with on RedHat Linux?
Thursday, February 24, 2005
Um... very interesting:

Now I wonder if there is anything which will take Excel template and stick your data into it on RedHat...
Thursday, February 24, 2005
I think there's something called jexcel or maybe jexcelapi that can do this.  It's a Java api.  Google might help.
Aaron F Stanton Send private email
Thursday, February 24, 2005
Thanks for your suggestions, please keep posting them!

Meanwhile, I've found Perl and Java API-s. I dislike both solutions, because we do not use any Perl or Java at the moment.

Currently I'm looking on the VBA ways of doing the trick:
1. Download Excel workbook, a macro fires.
2. Macro goes back to the server, fetches the values.
3. Macro disables itself, so it fires only once.
Thursday, February 24, 2005
Yep, it works. :-) I mean download XML with a macro. So I go for my VBA plan:

1. Create a Excel template and save on server.
2. Everytime the template is downloaded it will have a VBA event on "Open".
3. Then it will try to download a foo.xml from the server. Because I embed a session ID into URL the request will go to the same user session. So I can generate foo.xml on fly, using session defaults.
4. Once the worksheet is populated - disable download on Open event, so it can be saved, sent over Email etc.

Makes me happy.
Thursday, February 24, 2005
I have used the Perl module many times before. It is easy to learn and produces real excel files. It supports text formating, formulas, embedded images and charts.

And it is free!
Thursday, February 24, 2005
Take a look at this - (via
Anon Send private email
Thursday, February 24, 2005
I had good luck a year or two ago using SoftArtisan's ExcelWriter...

(But I believe it's .NET only)
Matt Send private email
Thursday, February 24, 2005
Excel has a documented format called XMLSS, which represents the Excel object model as XML. (Dunno if that's what you meant Terry.)

The MIME type is still "text/xml" but a XML PI causes it to be sent to Excel.

Most objects come across fine, except for images.

I use SQLXML to generate data, then through an XSL stylesheet on the server to output XMLSS.
Glen Low Send private email
Sunday, February 27, 2005
At my company we have written half a dozen web applications that provide the final output as a an excel spreadsheet.

Our solution that has been implemented the same way each time is to create the excel spreadsheet file on the server with a unique filename and then response.redirect the user to this excel file.

Since we know all users have Excel on their machines (ie. intranet with standardized PCs) how could one create
an excel spreadsheet on the client and not on the server?

Oxblood Send private email
Thursday, March 17, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz