How to Import data from Object Collection

I am using Aspose for generating excel reports for our web site (development environment: VB.Net).

I need to import data for worksheet from Collection of objects with get/set Properties in it.
There are methods ImportObjectArray, ImportTwoDimensionArray etc but I am not able to find which method supports to fill the cells of the sheet from custom BusinessObject collection.

Thanks

Hi,

Could you give us details about your BusinessObject collection. I think you may try to utilze Cells.ImportArrayList to extract the System.Cellections.ArrayList data objects to fill the worksheet cells.

Thank you.

Thanks for the promt reply.

I am finally able to generate ArrayList from System.Collections.ObjectModel.Collection(Of T) and pass it to sheet using method “sheet.Cells.ImportArrayList(arrList, 1, 1, True)”. But now problem is that the generated excel is displaying only single column of the ArrayList objects and not all the columns.

My ArrayList consists of objects which has bunch of get properties in it, and I want to display all of them in the sheet.

Please let me know the solution to this issue if you have it.

Hi,

Well, Cells.ImportArrayList() may not suit entirely for your scenario. I think you should convert the custom BusinessObject to an array values by yourself and then use Cells.ImportTwoDimensionArray() method to import your data to the Worksheet(s).

Thank you.