Posted 22 October 2021, 2:16 am EST
When the list of accounts is empty grapecity throws a NPE.
Expectation: I would like to know if there is a way to not show rows A2 to A4 if list of accounts is empty.
PFA excel template and exception stacktrace present in zip file
final List<Account> accounts=new ArrayList<>();
final Map<String, Object> dataSourceMap = new HashMap<>();
dataSourceMap.put("account", accounts);
final Workbook workbook = new Workbook();
workbook.open(templateFilePath);
dataSourceMap.forEach((key, value) -> workbook.addDataSource(key, value));
workbook.processTemplate();
Class Account{
String name;
String List<String> statementNames;
}
```[zip filename="grapecity.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-fdfaa484-f38c-488f-9799-d9e87378a872.zip[/zip]