because of small documentation i have problems with OpenXml SpreadSheetDocument in C#.
Open format? Office Open XML (also informally known as OOXML) is a zipped, XML-based file format developed by Microsoft for representing spreadsheets, charts, presentations and word processing documents. Ecma International standardized the initial version as ECMA-376.
Use the GetIdOfPart(OpenXmlPart) method to get the Id of the Sheet. Then add the new sheet to the Sheet collection by calling the Append([]) method of the Sheets class. The following code example creates a new worksheet, associates the worksheet, and appends the worksheet to the workbook.
SharedStringTable in SpreadsheetMLAn instance of this part type contains one occurrence of each unique string that occurs on all worksheets in a workbook. A package shall contain exactly one Shared String Table part. The root element for a part of this content type shall be sst.
I think that your question is really about how to create tables in a spreadsheet. Tables are a cool feature of Open XML / Excel 2007 / 2010 that enable you to sort a range of cells by clicking on column headings. Also they are presented with alternative color bands for rows. There are additional features, such as ability to have a total row, and automatic expansion when you insert a row.
I've written a blog post about tables and how to create them: Exploring Table Markup in SpreadsheetML. In addition, I've recorded a 15 minute screen-cast that explores the markup, and shows how to create an Open XML SDK program that converts ordinary cells into a table.
-Eric
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With