views:

239

answers:

2

Hi, I'm using IReport 3.5.0 and my java GWT application uses the compiled .jasper file, to create a report. I'm creating the datasource in the java application and use fillReport() method to fill the report. It works fine, it fills the fields that I have defined both in the .jrxml and Java application.

However, I want to use those fields to create a pie chart, and it doesn't work. I give my working fields as key and value expressions for the chart, but when I run the application, it gives the error java.lang.IllegalArgumentException: Null 'key' argument. I couldn't solve it, even when I give $V{PAGE_COUNT} as key expression, it always give the same 'null key' error. I'm stuck. Thanks for any help.

+2  A: 

I remember I had a simular problem with an older version of IReport. This thread was useful to me to fix it, so maybe it helps you with your problem as well: Jasper Forge.

ymene
+3  A: 

I had the same kind of issue. Basically the Pie Chart in JasperReport hates null object. The error message doesn't help very much...

Since you have already check for the key expression, check every other elements. My error was in a label expression!

If you can run your application in a IDE, put a breakpoint on "IllegalArgumentException". It will help you find the root cause. Also make sure the report recompile the jrxml every time you make a change.

Another approach would be to start with an example and modify it to fit your need little by little. You will find the culprit soon enough!

By the way, this has nothing to do with GWT since this all run on the server.

Thierry-Dimitri Roy