Friday 15 January 2010

java - Issue downloading report exported to PPTX when deployed on server -



java - Issue downloading report exported to PPTX when deployed on server -

we generating our reports using jasperreports 5.6.1, , allow exporting same template pdf or powerpoint. when running locally, pdf , pptx file downloaded work perfectly. when deploy our servers pdf works fine, pptx files cannot opened. when run locally, deployed tomcat, when deployed server running on websphere.

things tried , noticed:

i have checked logs, , there no exceptions or raise eyebrows. the file downloaded larger 1 when run locally. if changed extension of files zip, , unarchived them. file construction , file names same, along files beingness same file size. contents seem different in names objects found in each slide. thinking may problem x type files tried exporting xlsx also, see happen, , works fine same template. i added static pptx file known good, , can download without issue server. did seek eliminate server config issue, , sense worked, assuming code, not sure what.

here code write response:

if ("xlsx".equals(type)) { response.setcontenttype("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setheader("content-disposition", "attachment; filename=" + filename + ".xlsx"); } else if ("pptx".equals(type)) { response.setcontenttype("application/vnd.openxmlformats-officedocument.presentationml.presentation"); response.setheader("content-disposition", "attachment; filename=" + filename + ".pptx"); response.setcharacterencoding("utf-8"); } else { response.setcontenttype("application/pdf"); response.setheader("content-disposition", "attachment; filename=" + filename + ".pdf"); } seek (final bytearrayoutputstream reportresult = reportsservice.generatereport( getdeal(userid, dealid, sessionstore), getscenariomodel(userid, dealid, scenarioid, sessionstore), reportid, type)) { configureresponse(response, type, reportresult, dealid + "-" + scenarioid); // write http response reportresult.writeto(response.getoutputstream()); } response.flushbuffer();

i have run out of ideas on troubleshooting steps, , without beingness able reproduce locally, finding hard diagnose.

java jasper-reports powerpoint

No comments:

Post a Comment