Ireport报表在IE中无法显示

exdents_宏微 2011-09-03 11:32:38
Ireport报表在IE中运行时,IE直接吧它当成是下载文件给处理了。
各位高手如何处理,给小弟个建议 谢谢!!!
...全文
139 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
exdents_宏微 2011-09-05
  • 打赏
  • 举报
回复
我把代码粘贴出来看看,
File reportFile = new File(application.getRealPath("classic.jasper"));

//向报表中定义的参数赋值
Map parameters = new HashMap();
Integer i=new Integer(8);
// parameters.put( "pjId ", i);
// parameters.put("userpwd","sddddddd");
//parameters.put("username","badd");
//parameters.put("userrole","00000000");
byte[] bytes =
JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
conn
);

response.setContentType( "application/pdf ");

response.setContentLength(bytes.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();
//解决java.lang.IllegalStateException: getOutputStream() has already been called for this response
out.clear();
out = pageContext.pushBody();
exdents_宏微 2011-09-05
  • 打赏
  • 举报
回复
其它的浏览器都没有问题,就是IE的上面访问不行,pdf文件我在机子上也装了,但是现在问题依旧
mp866 2011-09-03
  • 打赏
  • 举报
回复
ie的事,你试试别的浏览器
  • 打赏
  • 举报
回复
Ireport 就没用过 你试一试其他的浏览器 喃?
反正我用的时候 没有遇到 这个问题 ... chart

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧