Free Support Forum - aspose.com

Populeting excel object which has list of objects inside using smartmarkers

Hi all,


I have below class
class data
{
public string Action { get; set; }
public string Pfam { get; set; }
public List AgmData { get; set; }

public data(string action,string pfam, List lst)
{
Action = action;
Pfam = pfam;
AgmData = lst;
}
}

In the List agm is a class which has 4 more string properties I need to bind it using below code

List nl = new List();
nl.Add(new agm { Customer = “Agia”, Desc = “Agia Desc”, Quantity = “100”, SKU = “UT6-00005” });
nl.Add(new agm { Customer = “Agia”, Desc = “Agia Desc”, Quantity = “100”, SKU = “UT6-00005” });
nl.Add(new agm { Customer = “Agia”, Desc = “Agia Desc”, Quantity = “100”, SKU = “UT6-00005” });
data dt = new data(“Net New”, “Office 365 P4”, nl);
wb.Workbook = new Workbook(@“E:\WorkBook.Xlsx”);
wb.SetDataSource(“Data”, dt);
wb.Process(true);
wb.Workbook.Save(@“E:\Result.Xlsx”, SaveFormat.Xlsx);
wb.Workbook.Save(@“E:\Result.Pdf”, SaveFormat.Pdf);

now problem is im not able to access property under ‘nl’ list. I am using smartmarker as &=Data.AgmData.SKU but the field is not populating. any help regarding this is appreciated

Hi,

Thanks for your posting and using Aspose.Cells.

We are afraid, nested properties (sub-properties) are not supported. Only
one-level properties are supported.