Aamir
Aamir

Reputation: 1757

How to Export data from a dataset to Excel in c# whose rows are expandable?

I have a DataSet which has two tables. They have relation among them, like Customer and Orders.

I need to export this data into Excel in a way that the resulting excel will have rows that are expandable. So each Customer row will be expandable and, upon expansion, it will show that specific customer's orders.

I tried by creating nested html table rows, bu in vain.

Your help is greatly appreciated.

Note: I am working in a windows form application;

**

Thanks.

Upvotes: 1

Views: 715

Answers (1)

user816098
user816098

Reputation: 262

You could use the Excel object library (namespace Microsoft.Office.Interop.Excel) to create the target file, arrange the orders in the rows beneath each customer and group them so the user can expand and collapse them on demand (or, embed macros to expand/collapse based on other ways of user interaction).

There are ways to do this with better performance (and, IMHO, also easier to do) - I have used SpreadsheetGear for more complicated Excel exports and can recommend it wholeheartedly.

Upvotes: 1

Related Questions