We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Generate Excel File From Multiple Custom Objects

Dear Aspose support team,

Tried to generate excel file from custom objects as below.

Model Objects :

class C

{

public List a{ get; set; }
public List b{ get; set; }

}

class A

{
public string p1{get;set;}
}

class B

{
public string p2{get;set;}
}

Code :

ICollection obj = new List();
C c = new C();
obj.a = new List() { new A() { p1 = "Test1" } };
obj.b = new List() { new B() { p2 = "Test2" } };
obj.Add(c);
designer.SetDataSource("Result", obj);

In WorkSheet :

Cell 1 : &=Result.a.P1
Cell 2 : &=Result.b.P2

Getting the error [ 'System.Collections.Generic.List`1[ConsoleApplication1.A]' ]

Please let me know you need any more information

Thanks in advance for your support

Pandi Kumar A

Hi,


Well, Aspose.Cells provides smart markers feature and we have to take care of certain aspects while defining Smart Markers in the template files or while writing code segments for creating custom objects etc. We recommend you please see the document for your complete reference:
http://www.aspose.com/docs/display/cellsnet/Smart+Markers
Note: kindly see the description text and example codes under the following sub-headings in the document for your complete reference and re-modulate your codes accordingly:

Using Anonymous Types or Custom Objects

Using Nested Objects


Thank you.