Jasper report blank page

前端 未结 1 1474
感动是毒
感动是毒 2020-12-11 20:54

My jrxml and java code below . I am trying to create report with some text and values . However blank report is generated . I am pasing map to fill the report as parameter .

相关标签:
1条回答
  • 2020-12-11 21:44

    You are confusing the report data with parameters. I don't see that you have any report data, which is why you are getting an empty report. Further, you are filling a parameter named "Field" instead of the actual report data. So you either need to create a parameter called "Field" in your report, and then refer to it in the detail band, OR you need to pass the report data into your report something like

    JRBeanCollectionDataSource data = new JRBeanCollectionDataSource(dataSet);
    jasperPrint = JasperFillManager.fillReport(jasperReport, parameterMap, data);
    

    where dataSet is a collection, such as List<?>. Within the List, you would have an object where one of the properties is Field.

    0 讨论(0)
提交回复
热议问题