views:

321

answers:

1

Hi I've asked on the OpenXml Sdk forum but that place seems about as active... not very active.

I'm doing some server side excel output using the OpenXML Sdk v2 ctp. Has anyone here had any experience using this - mpre specifically:

Is there a way to add subtotals to data in a spreadsheet using the SDK? or do i need to manually iterate over the data adding the OutlineLevel property?

rows.Add(new Row(cells.ToArray()) { RowIndex = (UInt32Value)Convert.ToUInt32(idx), Spans = new ListValue() { InnerText = "1:2" }, OutlineLevel = (ByteValue)groupLevelCount });

this would be a real PITA if I have to do it manually as there I need to do multi level grouping and sorting :s

-- Cheers,

w://

+2  A: 

Have you tried to use the document DocumentReflector included in the SDK? DocumentReflector tool can load an OpenXML document and reverse engineer the code for generating that document with the SDK. In other words, it generates C# code from an xlsx file.

The DocumentReflector tool is located in the Tools folder under the Open XML Format SDK 2.0 installation folder.

Maybe it can help to fix your issue.

Martin
It does to an extent - but I'm translating from an IList<Obj> to excel so - where in the reflector tool it uses a procedural method to add rows to the worksheet - I need to iterate through the collection and was hoping there was some fucntion I could apply to the worksheet after the data was added to create the subtotals for me. The only way I can see to do this right now is to iterate over the data once it's added, do the grouping and sumarising manuall - which is an utter PITA :s
wayne-o