Generate excel file for each case
I tried pxGenerateExcelFile activity in the loop of pxResults, it is creating only one file with last case. My requirement is to either generate separate excel file or separate tabs for each case.
I tried importing the tabs template in the binary rule, but data not populating if I mention the subscript index. Moreover I need the approach to include the tabs dynamically.
Is there any ootb approach for this or any other ways to implement it without customizing much?
@Nirmala - Are you saying you want to generate tabs dynamically i.e. e.g. depending on certain case data, there would be 3 tabs or 5 tab? This wouldn't be possible using pxGenerateExcelFile and the binary file template approach. You would need to use Apache POI libraries (available OOTB with the product) for generating dynamic tabs.
Following is a sample code snippet. You can use it in a loop to generate multiple worksheets.
// Create a workbook, corresponding to an excel file
org.apache.poi.xssf.usermodel.XSSFWorkbook wb = new org.apache.poi.xssf.usermodel.XSSFWorkbook();
// Add a first sheet in the workbook, corresponding to the sheet in Excel
org.apache.poi.xssf.usermodel.XSSFSheet sheet1 = wb.createSheet("Sheet 1");
// Add a second sheet in the workbook, corresponding to the sheet in Excel
org.apache.poi.xssf.usermodel.XSSFSheet sheet2 = wb.createSheet("Sheet 2");