Jump to content

Error in integrating JasperReports with Hibernate


Recommended Posts



I am getting Error while integrating Jasper reports with Hibernate...




I have the following code..



List list = s.getReportsData ("shantanu9@xyz.com","AnujTest","Subscription",stamp,estamp);


JasperReport jasperReport;

JasperPrint jasperPrint;


Map parameters = new HashMap();


JasperDesign jasperDesign = JRXmlLoader.load



jasperReport = JasperManager.compileReport(jasperDesign);


JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);

jasperPrint = JasperManager.fillReport(jasperReport, parameters, ds);


JasperManager.printReportToPdfFile(jasperPrint, "C:/eclipse/workspace/anuj/com/test/Report.pdf");




The list which my Business Layer is returning consists of a Transaction table rows in which each coulmn represents Other class for eg one column represents SaasUserImpl.class. After I pass the list to Jasper reprt's xml file i get Class Cast exception that class cast exception SaasUserImpl.. n if I type cast it into my known class by using object it says invalid report format...




<reportElement mode="Opaque" backcolor= "#ffdd99" positionType="Float" x="132" y="12" width="80" height="20"/>


<textElement textAlignment="Center"/>


<textFieldExpression class="java.lang.String"><![CDATA[$F{userId}_getLoginName()]]></textFieldExpression>





Kindly let me know is there any way i can retrieve my class objects in the xml file....








Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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