views:

34

answers:

1

How can export Master/Detail data to Excel in C#?

I wont to have some think like these without the dropdownlist:

http://blogs.msdn.com/blogfiles/excel/WindowsLiveWriter/CreatingaMasterDetailViewinExcel_12A09/image_thumb_5.png

How these can be done???

+1  A: 

I recommend to use a third party framework for exporting data to Excel templates like SpreadsheetGear (www.spreadsheetgear.com). Its not cheap but it does the job pretty good.

If you dont want to buy or use an external component you could still create and layout Excel files with XSLT (https://secure.wikimedia.org/wikipedia/de/wiki/SpreadsheetML). But this works only with Excel 2003 and above.

Another approach could be to fill an existing Excel template with OleDB (seems outdated but still good to get an idea: www.codeproject.com/KB/office/excel_using_oledb.aspx). You cannot layout the Excel file (like coloring a column or setting a specific font) with OleDB afaik.

still.organic