Thursday, September 01, 2005

Excel XML Writer: Generating Excel Workooks without Excel

Generating Excel Workooks without Excel

"Why I wrote Excel Xml Writer
One day I found myself having to build a Web Application that one of the requirements involved generating a nice Excel Workbook that users could then play with. This required quite some styling and several other features that you can only do with Excel (like setting printer options and document properties).

...

Solution
Luckily ever since Office XP, Excel supports a new file format called Xml Workbook (or something like that), this allow you to create an Xml document that follows a certain schema and Excel will work as if it were the binary XLS format (though not all features at supported like Charts).

....

This is exactly what Excel Xml Writer is, just a simple object model that generates Xml following the Excel Xml Workbook schema. ...

...

Now, even better I decided to write a code generator tool so that you don’t need to write all the styling code and superficial stuff and just focus on the actual data. This tool allows you to open an Excel Xml Workbook that you have created in Excel, and it will generate the C# or VB.NET code that you can use to generate it. This means that you can create the skeleton with all the formatting options in Excel and then just generate the code. ..."


This sounds like a VERY cool C# component. The code generator is a great addition too. You can really tell when someone is using their own tools...

Make sure you also check out some of the cool things on Carlos's site. The CodeColorizer sounds nifty. Now if only I felt IP safe enough to post code...

(via Richard Dudley - August BADNUG Meeting - ExcelXmlWriter and Skinning DotNetNuke

No comments: