ireport 用html页面上 图片怎么都出不来 全是红叉的处理办法

我用的是springmvc +mybatis+ireport 

jasper-views.xml

<context:property-placeholder location="classpath:spring-views.properties" />

<bean id="htmlReport" p:reportDataKey="datasource" 
class="org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView">
<property name="url" value="${dzxxsz}"></property>
<property name="exporterParameters">
<map>
<entry
key="net.sf.jasperreports.engine.JRExporterParameter.CHARACTER_ENCODING">
<value>UTF-8</value>
</entry>
<entry
key="net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN">
<value>false</value>
</entry>
<entry
key="net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR">
<value>false</value>
</entry>

</map>
</property>
</bean>

控制层:

@RequestMapping("/getpdfReport")
    public ModelAndView doSalesReportPDF(ModelAndView modelAndView,HttpServletRequest request) 
{
    
logger.debug("Received request to download PDF report");
MockDataFactory dataprovider = new MockDataFactory();


JRDataSource categoryData  = dataprovider.getCategoriesData();
Map<String,Object> parameterMap = new HashMap<String,Object>();

List<TUser> list=this.userServiceI.getall();
List<JUser> list1=new ArrayList<JUser>();
for (TUser tUser : list) {
JUser j=new JUser();
BeanUtils.copyProperties(tUser, j);
list1.add(j);

}
JREmptyDataSource emptyData = new JREmptyDataSource();
parameterMap.put("datasource",  new JRBeanCollectionDataSource(list1));
 /*生成HTML文件 */        modelAndView = new ModelAndView("htmlReport", parameterMap); return modelAndView; }

 
  


spring-views.properties

Reporturl=/WEB-INF/reports/UserReport.jrxml
dzxxsz=/WEB-INF/reports/dzxxsz.jrxml


转载于:https://my.oschina.net/u/867543/blog/131032

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值