TreeView (Import into Excel)

Hi,

I’m doing some development work in C#.

I have a tree view control which is populated. I’d very much like to export this tree view control into a spreadsheet. Ideally using the group functionality to maintain the hierarchical structure?

Can this be easily done?

Cheers,

Andy.

Hi,

Thanks for using Aspose.Cells for .NET.

Grouping can easily be done using Aspose.Cells. However, you will have to write your own logic, how to parse your tree for entering the data in your output xls/xlsx file.

Please see the following article for your reference.


Please also see the articles in the following section which illustrate various ways of working with your data.

Hi,


I am afraid there is no direct way to directly import a tree view .NET control to render it as Grouped data (Group Rows/Columns accordingly), also, there is no such feature in MS Excel that could do this.

You have to import all the data(from your tree view control) to fill/place it in the worksheet, then you will use Grouping data APIs (provided by Aspose.Cells) to do the grouping in rows and columns accordingly.

Moreover, to import data from treeview control, if you (could) have its source data in an array, datatable or list or some other source, you may directly import it via Aspose.Cells APIs in one go, see the topic for your reference:
http://www.aspose.com/docs/display/cellsnet/Importing+Data+to+Worksheets

Also, see the document on how to group rows and columns:
http://www.aspose.com/docs/display/cellsnet/Grouping+Ungrouping+Rows+and+Columns