// Create a new workbook Workbook workbook = new Workbook(); //Load template file from resource InputStream templateFile = this.getResourceStream("xlsx/ComplexMultiDataSource.xlsx"); workbook.open(templateFile); //Create table data sources from JSON JsonTable order = new JsonTable(getResourceStream("json/order.json")); JsonTable customer = new JsonTable(getResourceStream("json/customer.json")); JsonTable product = new JsonTable(getResourceStream("json/product.json")); //Add data source workbook.addDataSource("order", order); workbook.addDataSource("customer", customer); workbook.addDataSource("product", product); //Invoke to process the template workbook.processTemplate(); workbook.getWorksheets().get(0).getRange("A:F").setColumnWidth(16); // Save to an excel file workbook.save("CustomDataTable.xlsx");