// Create a new workbook Workbook workbook = new Workbook(); //#region Define custom classes //public class SalesRecord { // public String area; // public String city; // public String category; // public String name; // public double revenue; //} //#endregion //#region Init data SalesRecord record = new SalesRecord(); record.area = "North America"; record.city = "Chicago"; record.category = "Consumer Electronics"; record.name = "Bose 785593-0050"; record.revenue = 92800; //#endregion IWorksheet worksheet = workbook.getWorksheets().get(0); // Set binding path for cell. worksheet.getRange("A1").setBindingPath("area"); worksheet.getRange("B2").setBindingPath("city"); worksheet.getRange("C2").setBindingPath("name"); worksheet.getRange("D3").setBindingPath("revenue"); // Set data source. worksheet.setDataSource(record); // Save to an excel file workbook.save("CellBinding.xlsx");