java使用Ireport问题!我不要使用F参数,报表界面里也只有P参数,可总是一直报错!求高手啊,分好说!
一开始这样(传新空数组或者NULL都报这错):JRBeanCollectionDataSourcejrds=newJRBeanCollectionDataSource(n...
一开始这样(传新空数组或者NULL都报这错):JRBeanCollectionDataSource jrds = new JRBeanCollectionDataSource(new ArrayList());
JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport,
parameters,
jrds);
JasperPrintManager.printReport(jasperPrint, false);
报错如下:net.sf.jasperreports.engine.JRException: Invalid page index range : 0 - -1 of 0
at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:127)
at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:88)
at net.sf.jasperreports.engine.JasperPrintManager.printPages(JasperPrintManager.java:374)
at net.sf.jasperreports.engine.JasperPrintManager.printReport(JasperPrintManager.java:265)
然后查了下API发现可以不传JRBeanCollectionDataSource 如下直接:
JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport,
parameters);
JasperPrintManager.printReport(jasperPrint, false);可还是报一样的错,这可如何是好愁死了!附上报表截图,全设置的String类型! 展开
JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport,
parameters,
jrds);
JasperPrintManager.printReport(jasperPrint, false);
报错如下:net.sf.jasperreports.engine.JRException: Invalid page index range : 0 - -1 of 0
at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:127)
at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:88)
at net.sf.jasperreports.engine.JasperPrintManager.printPages(JasperPrintManager.java:374)
at net.sf.jasperreports.engine.JasperPrintManager.printReport(JasperPrintManager.java:265)
然后查了下API发现可以不传JRBeanCollectionDataSource 如下直接:
JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport,
parameters);
JasperPrintManager.printReport(jasperPrint, false);可还是报一样的错,这可如何是好愁死了!附上报表截图,全设置的String类型! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询