Page index out of range : 0 of -1

By: Raj - rajs1
Page index out of range : 0 of -1
2002-11-20 06:37
Why do I get this exception when the ResuktSet is of zero size?

dori.jasper.engine.JRException: Page index out of range : 0 of -1
at dori.jasper.engine.export.JRGraphics2DExporter.exportReport(JRGraphics2DExporter.java:202)
at dori.jasper.engine.print.JRPrinterAWT.printPageToImage(JRPrinterAWT.java:288)
at dori.jasper.engine.print.JRPrinterAWT.printPageToImage(JRPrinterAWT.java:154)
at dori.jasper.engine.JasperPrintManager.printPageToImage(JasperPrintManager.java:485)
at dori.jasper.view.JRViewer.refreshPage(JRViewer.java:867)
at dori.jasper.view.JRViewer.<init>(JRViewer.java:177)


Cheers
-raj


By: Raj - rajs1
RE: Page index out of range : 0 of -1
2002-11-20 07:55
Well,

Before filling the report I check the DataSource and if it is empty then I pass in a JREmptyDataSource().

But still IMHO should Jasper not do this internally?

Cheers
-raj


By: Teodor Danciu - teodord
RE: Page index out of range : 0 of -1
2002-11-20 13:07

Hi,

Have you checked the "whenNoDataType" attribute?

Thank you,
Teodor
2001 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:26am
Last seen: 17 years 1 month ago

0 Answers:

No answers yet
Feedback