Hi All, I am using a JRBeanCollectionDataSource to generate report. I have 2 layer of subreports. I send a datasource of type JRBeanCollectionDataSource .In report i required 4 fields i.e(qty,rate,poref,date) For poref and date i required one object of userdefined class(i.e PurchaseOrderItem). But the data source contains super class of PurchaseOrderItem i.e OrderItem. Sometimes it shows the blank report but sometimes it show NULLPOINTEREXCEPTION. even if When i am declaring filed <field name="purchaseOrderItem" class="com.realty.model.PurchaseOrderItem"/> it gives same Exception. But when i am declaring <field name="orderItem" class="com.realty.model.OrderItem"/> it does not give any exception. but how i retrieve poref and date from OrderItem(It is declare in its subClass PurchaseOrderItem) Can anyone help me please Its urgent. Thanks Nibedita Code:<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="MatrialConsumptionStatement_InventoryItem_subreport1" language="groovy" pageWidth="676" pageHeight="802" columnWidth="676" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="REPORT_JRXML_DIR" class="java.lang.String"/> <parameter name="totalGroupWiseEstimationValue" class="java.lang.Double"/> <parameter name="groupDescription" class="java.lang.String"/> <field name="qty" class="java.lang.Double"/> <field name="rate" class="java.lang.Double"/> <field name="purchaseOrderItem" class="com.realty.model.PurchaseOrderItem"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="72" splitType="Stretch"> <rectangle> <reportElement x="0" y="47" width="675" height="20" backcolor="#FFCCCC"/> </rectangle> <staticText> <reportElement x="69" y="47" width="41" height="20" forecolor="#6666FF" backcolor="#FFFFFF"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Qty]]></text> </staticText> <staticText> <reportElement x="137" y="47" width="35" height="20" forecolor="#6666FF" backcolor="#FFFFFF"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Rate]]></text> </staticText> <staticText> <reportElement x="248" y="47" width="51" height="20" forecolor="#6666FF" backcolor="#FFFFFF"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Value]]></text> </staticText> <staticText> <reportElement x="377" y="47" width="57" height="20" forecolor="#6666FF" backcolor="#FFFFFF"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Po.Ref]]></text> </staticText> <staticText> <reportElement x="507" y="47" width="48" height="20" forecolor="#6666FF" backcolor="#FFFFFF"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Date]]></text> </staticText> <staticText> <reportElement x="0" y="30" width="100" height="17" forecolor="#993300"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Estimate]]></text> </staticText> </band> </columnHeader> <detail> <band height="25" splitType="Stretch"> <textField isStretchWithOverflow="true" pattern="##,##,###,##0.00;(##,##,###,##0.00)"> <reportElement x="23" y="0" width="63" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.Double"><![CDATA[$F{qty}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="##,##,###,##0.00;(##,##,###,##0.00)"> <reportElement x="98" y="0" width="74" height="20"/> <textElement textAlignment="Right"> <font fontName="Arial"/> </textElement> <textFieldExpression class="java.lang.Double"><![CDATA[$F{rate}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="353" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{purchaseOrderItem}.getPurchaseOrder().getReferenceNo()]]></textFieldExpression> </textField> <textField pattern="dd-MM-yyyy" isBlankWhenNull="true"> <reportElement x="477" y="0" width="95" height="20"/> <textElement textAlignment="Center"> <font fontName="Arial"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[$F{purchaseOrderItem}.getPurchaseOrder().getOrderDate()]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="##,##,###,##0.00;(##,##,###,##0.00)"> <reportElement x="210" y="0" width="74" height="20"/> <textElement textAlignment="Right"> <font fontName="Arial"/> </textElement> <textFieldExpression class="java.lang.Double"><![CDATA[$F{rate}*$F{qty}]]></textFieldExpression> </textField> </band> </detail> <summary> <band height="26"> <textField pattern="##,##,###,##0.00;(##,##,###,##0.00)"> <reportElement x="98" y="6" width="202" height="20"/> <textElement/> <textFieldExpression class="java.lang.Double"><![CDATA[$P{totalGroupWiseEstimationValue}]]></textFieldExpression> </textField> <staticText> <reportElement x="23" y="6" width="75" height="20"/> <textElement> <font fontName="Arial"/> </textElement> <text><![CDATA[Total estimate]]></text> </staticText> </band> </summary></jasperReport>