Hi,
Thank you for sending me the jar file.
I tried with the latest jar which you have sent, but even then i am facing the same problem.
when i generate excel file with pivot table and pivot chart through web application, a popup window will diaplay for the file download.
when i click on Open button in the window, generated xls will been opened with data source sheets, but pivot table sheets are not populated but the when you click on the pivot chart area in the sheet bourder of he pivot table is displayed without data and pivot chart is not been generated.
But for the same excel generation action, when i click on the save button and try to save the file on my local disk and the try to open the saved file in that case is xls file is generated as per the requirement(source data sheets with data, pivot tables with data and pivot chart is also been generated successfully).
I didnt understand why report is not generated properly on click on open button.
Sample code to get byte array of the workbook.
ByteArrayOutputStream stream = new ByteArrayOutputStream();
workbook.save(stream, FileFormatType.EXCEL2003);
byt = stream.toByteArray();
The above byte array is set to the HTTPServletResponse object, Code is as below
response.addHeader("Content-Disposition", "attachment; filename=\""
+ reportBean.getReportType()+".xls" + "\"");
response.setContentType("application/octet-stream");
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "must-revalidate");
int totalLength = content.length;
response.setContentLength((int) totalLength);
OutputStream outputStream;
try {
outputStream = response.getOutputStream();
outputStream.write(content);
outputStream.flush();
outputStream.close();
} catch (IOException e) {
throw new DmnRtException("Could not write data to response stream",e);
}
Please have a look on the above code and could you please suggest the solution to over come the above problem.
Thanks in Advance.