Jeff Smith Blog

Random Thoughts & Cartesian Products with Microsoft SQL Server

Rendering Excel and Word files with SQL Server

I've been playing around with a handy tool for creating Word and Excel files called OfficeWriter that's pretty impressive. Basically, you use Excel or Word to create templates utilizing data markers and merge fields which allow you to databind sections of the document to a data source. It's almost like writing a databound ASP.NET page, only you are using Word or Excel instead of HTML ... a pretty neat idea now that I think of it. Then, using their libraries installed on your server, your ASP/ASP.NET applications can generate documents/spreadsheets based on these templates without the need for Microsoft Office on the server. I've just started to explore the features, but it makes creating Microsoft Office documents programmatically pretty simple and it's quite flexible in the options provided. Their library seems to include pretty much all of the document manipulation methods that you need, and all without creating Word/Excel COM objects on your server.

There's also an integration with Reporting Services that will let you create these documents without any coding at all. Users design RS reports with Excel and Word and don't have to understand Visual Studio or SQL Report Builder. I've only scratched the surface so far, but it seems that they've pretty much thought of every way you'd ever want to generate an Office document and they've got it covered!

Overall, it's definitely something worth looking into if you need any of these features. You can check it out here:

Legacy Comments
re: Rendering Excel and Word files with SQL Server
Very nice jeff.
VERY nice!

Kent Rosen
re: Rendering Excel and Word files with SQL Server
I work for Extentech, developer of a competing all-java Spreadsheet solution. Late last year, we were surprised to begin hearing reports from OfficeWriter customers that SoftArtisans was ending their support of the Java-based version of OfficeWriter in favor of their .NET version. <> While we were unable to independently verify this fact, we’ve gotten a number of inquiries from their customers lamenting this alleged situation.

In response to requests by these OfficeWriter customers we have created a way to use the same data markers contained in their templates so that they may continue using them in the same way that they were originally developed using OfficeWriter.