masdar Posted September 8, 2009 Share Posted September 8, 2009 i use iReport 3.5.2in my report i have the query: SELECT BTCS.OTA AS OTA, count(*) AS counter FROM BTCS GROUP BY BTCS.OTAwhich executed successfullythis query return 2 valuesOTA java.lang.StringCOUNTER Java.lang.BigDecimali inserted a pie chart in Summary sectionthe chart has the follows valuesDataset-> Reset type : Report Increment type:NoneDetails-> Section value-> Key expression: $F{OTA} Value expression: $F{COUNTER} Label expression: $F{OTA}---------------------------------------------------------------------------------------in compiling there is not problembut when i preview the report i get an errorError 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 More sharing options...
kchaudhry Posted September 8, 2009 Share Posted September 8, 2009 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 More sharing options...
masdar Posted September 9, 2009 Author Share Posted September 9, 2009 Thank you alot,, i'll try that, 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