六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 78|回复: 0

Struts2整合JasperReport预览HTML格式不显示图片问题解决方案

[复制链接]

升级  72%

46

主题

46

主题

46

主题

秀才

Rank: 2

积分
158
 楼主| 发表于 2013-2-7 15:20:08 | 显示全部楼层 |阅读模式
    关于怎么整合网上到处都是例子、apache也有比较详细的例子说明,我是参考这篇文章的http://www.blogjava.net/sterning/archive/2008/01/02/172317.html我使用他的源码HTML预览时还是不能正常显示,images/px(网上的一种解决方案)都有还是不能正常显示,无奈之下只有查看源代码了。
Struts2对通过JasperReportsResult.java类的doExecute方法对JasperReport进行了简单的整合,这个方法对JasperReport的API简单的包装(车轮理论^_^)
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee;">JasperReport jasperReport = (JasperReport) JRLoader.loadObject(systemId);
            jasperPrint 
= JasperFillManager.fillReport(jasperReport, parameters, stackDataSource);
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表