mike Posted November 16, 2006 Share Posted November 16, 2006 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 More sharing options...
Teodor Danciu Posted November 16, 2006 Share Posted November 16, 2006 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 More sharing options...
mike Posted November 17, 2006 Author Share Posted November 17, 2006 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 More sharing options...
Teodor Danciu Posted November 22, 2006 Share Posted November 22, 2006 Hi, I think you should try display the chart conditionally using the printWhenExpression based on the REPORT_COUNT or some other build-in count variable that corresponds to the number of records you are feeding into the chart dataset. I have not tested this, but I hope it helps.Teodor Link to comment Share on other sites More sharing options...
scorpiophd Posted December 29, 2010 Share Posted December 29, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now