Aspos Cell - Java Smart markers for Pojo not working

Hi Aspose Team,

Aspose.Cell version 23.10

I am doing POC on creating an excel file using smart markers and POJO data source in java but it’s not working as expected.

I have followed the below documentation but still doesn’t not work.

Using Smart Markers|Documentation.

I have the below excel file

image.png (4.1 KB)

And the below java code:

WorkbookDesigner designer = new WorkbookDesigner(new Workbook(dataDir + “TestSmartMarkers.xlsx”));
designer.setDataSource(“myObj”, List.of(new Individual(“John”, 19),
new Individual(“Jane”, 12)));
designer.process();
designer.getWorkbook().save(dataDir + “UsingNestedObjects_out.xlsx”);

class Individual {
private String name;
private int age;

public Individual(String name, int age) {
	this.name = name;
	this.age = age;
}

public String getName() {
	return name;
}

public int getAge() {
	return age;
}

}

What do I need to change to get it work?

Thanks

@abdullah240
You need to add a public decoration to the entity class. After adding and testing, we can obtain the correct results. Please refer to the attachment (13.0 KB).

The sample code as follows:

WorkbookDesigner designer = new WorkbookDesigner(new Workbook(filePath + "TestSmartMarkers.xlsx"));
	
designer.setDataSource("myObj", List.of(new Individual("John", 19),
new Individual("Jane", 12)));
designer.process();
designer.getWorkbook().save(filePath + "UsingNestedObjects_out.xlsx");

public class Individual {
	private String name;
	private int age;
	
	public Individual(String name, int age) {
		this.name = name;
		this.age = age;
	}
	
	public String getName() {
		return name;
	}
	
	public int getAge() {
		return age;
	}
}

Hope helps a bit.