Question

2
Replies
23
Views
RajasekharP5136 Member since 2016 4 posts
Virtusa
Posted: 6 months ago
Last activity: 6 months ago

Excel file generated using Apache POI classes is not opening

Generated excel file from java step from pega using below code,

        try (         XSSFWorkbook workbook = new XSSFWorkbook()) {               FileOutputStream out = new FileOutputStream(new File("createworkbook.xlsx"));               workbook.write(out);               out.flush();               out.close();

 

Ofcourse, I have fixed all errors at compile time with above code to add full class names. The problem is , File is getting generated however, the generated excel file while opening throwing error as "Excel cannot open the file <Filename> because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."           

Pega Marketing 7.31 Low-Code App Development Other Industry Solutions Consultant
Share this page LinkedIn