plot timeSeriex chart with multipleDataSet OR pass a Collection Object in JRBeanCollectionDataSource

Acually I have to plot timeSeries using jasperReport . How to generate the time series graph for different data sets? I am able to generate the time series graph when i have one data set to plot over a period of time. However when i have multiple data set to plot then i am facing problem.
I am using List data source.
    public class KpiReportPoints {
        private String deviceDn;
        private List<KpiReportPoint> kpiPoints;
    public class KPiReportPoint{
        private Date time;
        private Double value;
    public Date getTime() {
          return time;
        * @param time the time to set
       public void setTime(Date time) {
          this.time = time;
        * @return the value
       public Double getValue() {
          return value;
        * @param value the value to set
       public void setValue(Double value) {
          this.value = value;
       public int hashCode() {
          return time.hashCode();
       public boolean equals(Object obj) {
          boolean equal = false;
          if (obj instanceof KPIReportPoint){
             KPIReportPoint point  = (KPIReportPoint) obj;
             equal = time.equals(point.getTime())&& value.equals(point.getValue());
          return equal;
       public int compareTo(KPIReportPoint o) {
          return this.time.compareTo(o.getTime());
Both the above classes have their getters and setters and all are public ,so no problem according to me is there in the definition of each. I am passing the populated List<KpiReportPoints> as JRBEanCollectionDataSource(kpiReportpointsList)
Now below is my jrxml:
    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation="" name="KPI_Reports" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="191"/>
    <subDataset name="Dataset">
    <field name="time" class="java.util.Date"/>
    <field name="value" class="java.lang.Double"/>
    <parameter name="X_UNIT" class="java.lang.String">
    <parameter name="Y_UNIT" class="java.lang.String">
    <parameter name="REPORT_NAME" class="java.lang.String">
    <defaultValueExpression><![CDATA["KPI Report"]]></defaultValueExpression>
    <parameter name="from" class="java.util.Date"/>
    <parameter name="to" class="java.util.Date"/>
    <field name="deviceDn" class="java.lang.String"/>
    <field name="kpiPoints" class="java.util.List"/>
    <band splitType="Stretch"/>
    <band height="20" splitType="Stretch">
    <textField pattern="EEE, d MMM yyyy HH:mm:ss Z" isBlankWhenNull="true">
    <reportElement x="513" y="0" width="253" height="20"/>
    <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
    <band height="443">
    <chart isShowLegend="true" customizerClass="">
    <reportElement mode="Opaque" x="0" y="0" width="766" height="443" isPrintInFirstWholeBand="true"/>
    <chartTitle position="Top">
    <font size="14" isBold="true" pdfFontName="Courier-Bold" isPdfEmbedded="true"/>
    <chartLegend position="Bottom"/>
    <timeSeriesDataset timePeriod="Second">
                        <datasetRun subDataset="Dataset">
    <timeSeriesPlot isShowLines="true" isShowShapes="true">
    <plot labelRotation="90.0"/>
    <font size="10"/>
This issue is jrxml compiles fine but on trying to generate a report it throws the exception :
    [#|2014-10-10T09:59:05.769+0530|SEVERE|glassfish3.1.1||_ThreadID=290;_ThreadName=Thread-3;|net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : time
        at net.sf.jasperreports.engine.fill.JRFillData
I have been completely mad with this issue and not able to find even a single problem in the above code which may cause this . If any of you is able to see that and have any time faced this error then please give me some clue as to what is wrong . Thanks a lot in advance 
ruchiagraw's picture
Joined: Oct 8 2014 - 12:53am
Last seen: 8 years 5 months ago

0 Answers:

No answers yet