Null 'key' argument - Charts

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.

My reports is working. But at the moment I add a chart.. I always receive following error:

Null 'key' argument

This is since I upgraded frop iReport to Jaspersoft Studio!

full error message:

java.lang.IllegalArgumentException: Null 'key' argument.
at net.sf.jasperreports.charts.fill.JRFillCategoryDataset.customIncrement(
at net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(
at net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
at net.sf.jasperreports.engine.fill.JRFiller.fill(
at net.sf.jasperreports.engine.JasperFillManager.fill(
samhast's picture
Joined: Nov 4 2011 - 6:41am
Last seen: 5 years 7 months ago

4 Answers:

Have you set your chart components? Exactly which chart component are you trying to add and what is the exact steps you're taking?

I'm not getting any such error.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 3 weeks ago

Screenshot from my chart wizard:

This is my report:



samhast's picture
Joined: Nov 4 2011 - 6:41am
Last seen: 5 years 7 months ago

Also - looking for help with Charting. I have the same  NULL KEY issue stated above.


Is there a good "How to" guide for charts?

mwolven's picture
Joined: Jun 3 2015 - 11:21am
Last seen: 6 years 5 months ago

I'm trying the tutorial at and am getting the same error. 

This is using JasperReports 6.2 andjasper studio 6.2.

The graph in that tutorial is also a bar chart.

Are there any tricks for debugging this stuff?  Java stack traces into code you don't have sources to (org.jfree in this case) and exception messages like "null 'key' argument" are pretty useless.

Here's the jrxml generated from the example:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version using JasperReports Library version 6.2.0  -->
<!-- 2016-01-28T16:16:22 -->
<jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation="" name="GraphReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c029557d-c3bc-47e9-a5ff-f7544e7265cb">
    <property name="" value=""/>
    <property name="" value="Sample DB"/>
        <![CDATA[select count(*), SHIPCITY from orders group by SHIPCITY]]>
    <field name="C1" class="java.lang.Long"/>
    <field name="SHIPCITY" class="java.lang.String"/>
        <band splitType="Stretch"/>
        <band height="350" splitType="Stretch">
            <property name="" value="pixel"/>
                <chart evaluationTime="Report">
                    <reportElement x="0" y="0" width="555" height="350" uuid="eb78ea14-af53-4212-90f4-0186ec9effcf"/>
                    <categoryAxisLabelExpression><![CDATA[" "]]></categoryAxisLabelExpression>

kcrews's picture
Joined: Jan 20 2016 - 2:12pm
Last seen: 5 years 4 months ago