Thursday, October 22, 2009

Building Excel Files the Easy Way - A Little Sleight of Hand

Anyone who has created a data store has needed, at one time or another, to prepare or deliver a summarized report in a professional-looking way.

For instance, while I worked as a consultant, I was asked to create an excel file of financial data in a way that the financial system didn't support.  At the time, I used a LotusScript agent with OLE objects to the Microsoft Visual Basic Excel objects.  That is great, assuming that you can run the process on a machine that already has Microsoft Office installed. 

Sometimes, manipulating those MS objects also meant that Excel actually opened on the machine.  That meant that the user could interrrupt the process, change the data, etc.

For one project, I needed to run the process on a server.  When I explained to the admins that I needed to install MS Office on their dedicated Domino box, needless to say, I met with some resistance.

Then I stumbled on a solution that eliminated the need for extra installation or DLLs. 

I found that if I created my nicely-formatted report in HTML, then named it with an "xls" extension, Excel was more than happy to open it and display all the HTML formatting. 

There are a few limitations.  First, I haven't found a way yet to create a multi-sheet workbook - all the data appears on one page.  Second, it doesn't support javascript or editable fields. 

Give it a try - I think you'll like the possibilities that this new tool opens up for you!

No comments:

Post a Comment