Blank PDF even with the simplest Jasperreport jrxml

后端 未结 3 788
予麋鹿
予麋鹿 2020-11-27 18:41

i have a EJB site with glassfish 3.1 + JSF for jasperreport 4.0.1. the site has no problem on streaming pdf, but it products blank PDF while printing PDF with runReportToPd

3条回答
  •  半阙折子戏
    2020-11-27 19:13

    After all, JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, parameterMap, new JREmptyDataSource()); solved the problem.

    Quote from Sanda of Jasperreport:

    By default, when no datasource info is present in a report, JR generates no pages. Another option (which can be set in the report's whenNoDataType attribute) would be to print all report sections, excepting the .

    This report contains a detail section, but only with some static data. To ensure this section will be printed too, the simplest way is to provide an empty data source, containing a single empty record.

提交回复
热议问题