Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenXml Spreadsheet. Value filters, styles and unicode characters

because of small documentation i have problems with OpenXml SpreadSheetDocument in C#.

  1. How to make top row with filter?
  2. How to make colors to alternate?
  3. I want to put unicode characters in my SheetData, but when i oppen the excel it gives me an error..
  4. Change the top row color. Can you say if there are some proper ways to do this, some more documentation than these available on msdn, or post some StyleSheet code? Sorry for my english. Thanks.
like image 401
croisharp Avatar asked May 13 '11 14:05

croisharp


People also ask

What is OpenXml for Excel?

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.

How do I create an OpenXml file in Excel?

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.

What is SharedStringTable?

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.


1 Answers

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

like image 109
Eric White Avatar answered Nov 14 '22 23:11

Eric White