amitpandey Posted January 1, 2010 Share Posted January 1, 2010 Hi all, I am facing the problem in iReport with Beans integrations. I get the policyId, PolicyNo, receiptMasterCollection but i could not get the proposal values like proposalId from Proposal Beans. Can any one help me.And here is my BeansPolicy private java.lang.Long policyId; private java.lang.String policyNo; private Proposal proposal; private List receiptMasterCollection; public java.lang.Long getPolicyId() { return policyId; } public void setPolicyId(java.lang.Long policyId) { this.policyId = policyId; } public java.lang.String getPolicyNo() { return policyNo; } public void setPolicyNo(java.lang.String policyNo) { this.policyNo = policyNo; } public Proposal getProposal() { return proposal; } public void setProposal(Proposal proposal) { this.proposal = proposal; } public List getReceiptMasterCollection() { return receiptMasterCollection; } public void setReceiptMasterCollection(List receiptMasterCollection) { this.receiptMasterCollection = receiptMasterCollection; }--------------------------------------Proposal private java.lang.Long proposalId; public java.lang.Long getProposalId() { return proposalId; } public void setProposalId(java.lang.Long proposalId) { this.proposalId = proposalId; }--------------------------------------ReceiptMasterCollection private java.lang.Long receiptID; public java.lang.Long getReceiptID() { return receiptID; } public void setReceiptID(java.lang.Long receiptID) { this.receiptID = receiptID; }--------------------------------------Here is my ".jrxml" filesPOLICY_MOTOR.jrxml<?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="POLICY_MOTOR" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <property name="net.sf.jasperreports.export.pdf.compressed" value="true"/> <property name="net.sf.jasperreports.export.pdf.encrypted" value="false"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <parameter name="SUBREPORT_DIR" class="java.lang.String"> <defaultValueExpression><![CDATA["D:\\Code\\Java\\SGI\\2009\\10\\Citizen_1.1\\GWT_1_6_Shrisurance\\SrisureHome\\www\\com.shrisure.SrisureHome\upload_files\\JasperReports\\"]]></defaultValueExpression> </parameter> <field name="policyId" class="java.lang.Long"> <fieldDescription><![CDATA[policyId]]></fieldDescription> </field> <field name="policyNo" class="java.lang.String"> <fieldDescription><![CDATA[policyNo]]></fieldDescription> </field> <field name="proposalId" class="java.lang.Long"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="receiptMasterCollection" class="java.util.List"> <fieldDescription><![CDATA[receiptMasterCollection]]></fieldDescription> </field> <detail> <band height="200" splitType="Stretch"> <textField> <reportElement x="99" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Long"><![CDATA[$F{policyId}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="0" width="100" height="20"/> <textElement/> <text><![CDATA[Policy ID]]></text> </staticText> <textField> <reportElement x="99" y="19" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{policyNo}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="19" width="100" height="20"/> <textElement/> <text><![CDATA[Policy No]]></text> </staticText> <staticText> <reportElement x="0" y="38" width="100" height="20"/> <textElement/> <text><![CDATA[Proposal No]]></text> </staticText> <textField> <reportElement x="99" y="38" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Long"><![CDATA[$F{proposalId}]]></textFieldExpression> </textField> </band> </detail> <pageFooter> <band height="103" splitType="Stretch"> <subreport isUsingCache="true"> <reportElement x="0" y="0" width="595" height="67"/> <dataSourceExpression><![CDATA[new JRBeanCollectionDataSource($F{receiptMasterCollection})]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "RECEIPT.jasper"]]></subreportExpression> </subreport> </band> </pageFooter></jasperReport> 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