I have a method which returns StreamingOutput Object. And i want to write this StreamingOutput object into excel file. And i have written the following code, which is giving me the java.lang.ClassCastException Exception.
StreamingOutput stream = getStreamObject();
SXSSFWorkbook workBook = (SXSSFWorkbook) stream; //Exception occurs here
FileOutputStream fileOut = new FileOutputStream("/save/excel/file/here");
workBook.write(fileOut);
fileOut.flush();
fileOut.close();
So, Please help me out with this. Thank You in Advance.
SXSSFWorkbookfrom the StreamingOutput. no wonder you get exception there. you should create a new row/cell and callstream.write()on the cell.setValue()