Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper Report with iReport: setNoDataMessage not w


nao921

Recommended Posts

 I have a report that contains a pie chart within it. I would want the chart to be shown no matter if the query returns results or nothing at all. typically you just need to do the plot.setNoDataMessage() function, however since this is not exposed within iReport, i did it within the Customizer class (attached code)

however when i run it with no data returning, it is giving me a blank page and iReport pops up with "the document has no pages"

Please advise.

Code:
CategoryPlot plot = (CategoryPlot)chart.getPlot();    plot.setNoDataMessage("No data available so we go into this really "            + "long spiel about what that means and it runs off the end of the "            + "line but what can you do about that!");
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

nao921,

Your customizer is probably correct (I did not read it). You are not getting to it because the report is set to display nothing when there is no data. At the root report level find the property "When No Data". Try setting it to "All Sections, No Detail".

Regards,
Matt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...