Tag Archives: excel 2007

Pivot Tables Version Nightmare

Pivot tables can be tricky by nature and a significant portion of my support work has been dedicated to helping customersĀ incorporate pivot tables with ExcelWriter.

One customer wrote in with the following issue: his client had recently imposed a constraint that all reports had to be in the .xls format, so he needed to convert several OfficeWriter reports designed in Excel 2007 to the 2003 format, but he was having trouble switching the pivot tables.

When he tried to save the 2007 format report as a 2003 format report, the pivot tables were locked in a read-only state, wherein users could only edit the pivot tables if the report was resaved in the 2007 format. After doing some testing in Excel 2003 and 2007, I found that this was the native behavior for Excel files as well. Continue reading Pivot Tables Version Nightmare

Refactoring XmlWriter

I found this link interesting: http://elegantcode.com/2009/06/19/refactoring-xmlwriter/

XmlWriter and XmlReader are convenient and one of the fastest ways of creating XML, but they are kind of ugly sometimes. I wrote a class that encapsulated these methods into XmlFilter, which makes it easy to change pieces of an XML file without writing the same scaffolding over and over again, and without using an XmlDocument (which is quite a bit slower and consumed more memory than I preferred.)

The next release of Officewriter should be significantly faster (roughly 2 to 4 times as fast, according to current benchmarks) than the 4.0 release for parsing Excel 2007 files. This is mostly because I replaced a section of code that used the XmlDocument with a custom written replacement which was more specific to my needs. I don’t think the .NET framework (at least parts of it) was written with performance in mind, but I’ll get into that in a later blog post.