使用Spring mvc在JasperReports的表视图中显示数据

时间:2014-04-25 10:01:52

标签: java spring-mvc jasper-reports

我无法在 JasperReports 表中显示数据,视图变空。

但是在 iReport 中我可以显示相同的jrxml文件

Spring Controller中的代码:

@RequestMapping(value = "displayTradeList")
public ModelAndView displayTradeListHtml(ModelAndView modelAndView) {
    tradeList = service.getTradeList();

    JRDataSource JRdataSource = new JRBeanCollectionDataSource(tradeList);

    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("datasource", JRdataSource);

    //xlsReport bean has ben declared in the jasper-views.xml file
    modelAndView = new ModelAndView("htmlReport", parameterMap);

    return modelAndView;
}  please find below jrxml file:http://community.jaspersoft.com/questions/826043/display-data-jasperreportss-table-view

0 个答案:

没有答案