7

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.
Charles
  • 50,943
  • 13
  • 104
  • 142
croisharp
  • 1,926
  • 5
  • 25
  • 40

2 Answers2

2

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

Eric White
  • 1,851
  • 11
  • 14
0

I can't give you a silver bullet, unfortunately, but what I did when trying to work out how to build Word Documents with OpenXML was to do the work in Word, then explore the resulting .docx file to see what the effect was.

I've suggest that the same investigative approach may help you with your spreadsheet.

Steve Morgan
  • 12,978
  • 2
  • 40
  • 49
  • 1
    You reverse engineered the docx format? Isn't it an open format? – alex May 13 '11 at 14:44
  • I have a bidimensional list of object, i have to put there value in excel cells. – croisharp May 13 '11 at 14:48
  • @Alex, yes, it's an open format but poorly documented. I would say that 'reverse engineered' was a bit grand a term. More a case of engineering my own 'real world' examples ;-) – Steve Morgan May 14 '11 at 10:29
  • I resoved my problem using open xml productivity tool and 2 foreach loops for my List. – croisharp May 15 '11 at 17:11