Jump to content
We've recently updated our Privacy Statement, available here ×

anujgu

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by anujgu

  1. Hi,

     

    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

    ("C:/eclipse/workspace/anuj/com/test/jasperreports_demo.jrxml");

     

    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>

     

    </textField>

     

     

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

     

     

     

    regards,

     

    Anuj

    ...

×
×
  • Create New...