I am facing a problem in downloading the Excel Document in Browser either as an Attchement or inline type. First, the Browse asks me whether the Excel Document to be saved or opened. After I chose either save or open, it is opening the MS-Excel Application well, but before displaying workbok, there is an error message box saying that "Microsoft Excel for Windows has encountered a problem and needs to close. We are sorry for the inconvenience........ ".
I have written my code as below:
1) using Apache POI 3.0.2, I have workbook with a worksheet,cells and its values. 2) getting the bytes from the Workbook instance. 3) reading the bytes by using the BytesArrayInputStream piped with BufferedInputStream 4)reading the bytes in bulk-by-bulk (ie., 2048) and writing the same into BytesArrayOutputStream 5) flushing out the data from BytesArrayOutputStream into ServletOutputStream
-------------My Code snippet from a Servlet as below......----------------