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

problem :pie chart (Key is null)


masdar

Recommended Posts

i use iReport 3.5.2

in my report i have the query:


    SELECT     BTCS.OTA    AS OTA,
             count(*) AS counter
        FROM
              BTCS
        GROUP BY     BTCS.OTA

which executed successfully

this query return 2 values

OTA                  java.lang.String

COUNTER              Java.lang.BigDecimal

i inserted a pie chart in Summary section

the chart has the follows values

Dataset->

            Reset type : Report

            Increment type:None

Details->

                    Section value->

                             Key expression:    $F{OTA}

                           Value expression: $F{COUNTER}

                           Label expression: $F{OTA}

---------------------------------------------------------------------------------------

in compiling there is not problem

but  when i preview the report i get an error

Error filling print... Key is null in pie dataset.
net.sf.jasperreports.engine.JRRuntimeException: Key is null in pie dataset. 
    at net.sf.jasperreports.charts.fill.JRFillPieDataset.customIncrement(JRFillPieDataset.java:263) 
    at net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(JRFillElementDataset.java:179) 
    at net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(JRCalculator.java:152) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:716) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:276) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:118) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814) 
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:898) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) 

 



Post Edited by masdar at 09/08/2009 12:47
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

The problem is that your query is returning a null for $F{OTA} and therefore you are getting this error message. You can modify your query to exclude nulls for this field and that will resolve the issue. The reason why you don't get any error message at compliation time is due to the fact that the issue is with the data and not the report.

Hope this helps!

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