Jump to content

Null key argument.


mike

Recommended Posts

Hello,

 

 

I am using iReport-1.2.7

 

I am getting this error when i try to launch a report and dont exists data to display returned by the query.

 

ErrorÂfillingÂprint...

java.lang.IllegalArgumentException:ÂNullÂ'key'Âargument. ÂÂÂÂatÂorg.jfree.data.DefaultKeyedValues.setValue(DefaultKeyedValues.java:225) ÂÂÂÂatÂorg.jfree.data.DefaultKeyedValues2D.setValue(DefaultKeyedValues2D.java:291) ÂÂÂÂatÂorg.jfree.data.DefaultKeyedValues2D.addValue(DefaultKeyedValues2D.java:260)Â

 

 

 

I modify [Report properties] in order to set When no Data: No pages, BlankPage, AllSectionsNoDetail but it seems dont have effect because i am getting the error again.

 

 

Any help is greatly appreciated.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

You cannot test a chart by supplying null values simply because chart datasets do not support null values.

So you either test your chart using some real data or try filter the null values using <filterExpression>.

The filter solution will result in the chart dataset being filler with nothing and it make the test useless I guess.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

mmmm, i am using a Bars Chart. This Chart is generated when the user sends parameter in order to find data and display the result in a Bar Chart.

 

But, when the parameters dont math with Data so, i need to show blank page and dont abort

with NullÂ'key'Âargument.

 

This is possible to do it ?

Link to comment
Share on other sites

  • 4 years later...

I've had the same problem:

I have a chart in the summary section of iReport, and it needs to take 3 variables, all three integers.

If I just feed it Fields, it will not work, complaining of a null key argument or a null x argument depending on what kind of chart I choose to use.

The solution is simple!

I used the expression editor to set up a conditional to make sure that the Field I want to feed in to my chart, the Field that will go to the x axis that is, will never be null.

Here is the expression editor code: ( $F{x}==null ? Integer.valueOf(0) : $F{x} )

This will work for a Field of type Integer named x.

I hope this works for you all.. :)

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...