Excel Export dynamic multiple sheets

Hello Everyone! I try to export excel with multiple sheets with use of ExcelExport module. I don’t know how many sheets will be there as i need to create sheets based on input data – i have list of countries and i need to create each sheet for each region and put countries with this region there. What i was tried to do is create some template and configure some template sheet for it. Then i receive this sheet in the microflow and try to use deepcopy element to copy this sheet to new one with all references and associations it has. But when it comes to GenerateExcel function i always get error below, related to styles… Maybe someone did something similar and can help me on that or direct me to the right way on where to look for this error? Caused by: java.lang.NullPointerException: null     at xlsreport.report.data.ColumnPreset.setStyle(ColumnPreset.java:139)     at xlsreport.report.export.ExportExcel.buildExportFile(ExportExcel.java:91)     at xlsreport.actions.GenerateExcelDoc.executeAction(GenerateExcelDoc.java:133)     at xlsreport.actions.GenerateExcelDoc.executeAction(GenerateExcelDoc.java:34)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)
1 answers

If anyone is facing this same issue, the fix is actually pretty simple.

At this moment of writing, inside the XlsReport module, there is the microflow ‘IVK_TemplateSaveAndNext’ where a new CellStyle is created.


Add that Create to your custom microflow and associate it to your new MxTemplate. 

All Cellstyles used in your sheets and columns should also be associated to your Template. Keep it simple and create one single style and use it for your Template, Sheet and Column. Just pass it as a parameter.