Skip to content
Advertisement

net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0

When I try printing the Jasper report it gets me the message: “net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0”.

Code:

JavaScript

Report:

JavaScript

Could someone help me to figure out why is it happening?

Advertisement

Answer

JasperFillManager likes to get a data source, even when you don’t really have any. You could try adding an empty data source as a third parameter to JasperFillManager.fillReport:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement