Wednesday, March 28, 2012

Generating Xlsx's on the Server? You're using OpenXML, right? With help from the PowerTools for OpenXML?

OpenXML Developer - Quick Generation of Spreadsheet Data and Cell Styles

"This example looks at a couple of OpenXML spreadsheet topics. I have been working with the cell styles a lot lately and this is a first example showing how to add some of the named styles to a spreadsheet cell. I plan to include even more style options in my next example and blog post. Also, after I posted my example for generating a pivot table, some very helpful people mentioned that it was quite slow with large amounts of data. This example also shows an alternative method of generating large amounts of data in a worksheet.

The example code can be found at PowerTools for OpenXML on Codeplex. Look for the 2.2.3 release of the PowerTools Core.

The screen-cast is divided into two parts. The first half introduces the example and shows how to use the methods in the PowerTools Core library. The second half shows the details of how the XML is generated. If you are only interested in using the code as is, then you can skip the second part.

image

PowerTools for Open XML - PowerTools for OpenXML 2.2 (Note you want 2.2.3...)

image

Here's a snap of all you need to create a XlsX.  If you've ever used OpenXML, you'll know just how much time this can save you (and how much more sense this makes). OpenXML is great, but it's NOT the kind of Office API you're used too. This kind of library makes it that much easier to use...

SNAGHTML42fa277c

No Excel, no Office, all Net.

image

 

Related Past Post XRef:
Reusing the PowerShell PowerTools for Open XML in your C# or VB.Net world
PowerShell, OpenXML, WMI and the PowerTools for OpenXML = Doc generation for our inner geek
Because it’s a PowerShell kind of day… PowerTools for Open XML V1.1 Released
OpenXML PowerTools updated – Cell your Excel via PowerShell

No comments: