• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

create report with java

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to this report part. I downloaded ireport 3.7. And now I can design a report using ireport. Now I want to generate reports using a java application. I search through the internet and get some source cods. but that cods are with errors. Please help me to do this. I am using jdk 1.6.0_18 only and what is " import net.sf.jasperreports.engine.*; " ?

thank you.


the error is :


  • C:\Users\Dushantha\Desktop\a\JasperTest.java:1: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:2: package net.sf.jasperreports.engine.export does not exist
    import net.sf.jasperreports.engine.export.*;
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:13: cannot find symbol
    symbol : class JasperPrint
    location: class JasperTest
    JasperPrint print = JasperFillManager.fillReport(fileName, hm, new JREmptyDataSource());
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:13: cannot find symbol
    symbol : class JREmptyDataSource
    location: class JasperTest
    JasperPrint print = JasperFillManager.fillReport(fileName, hm, new JREmptyDataSource());
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:13: cannot find symbol
    symbol : variable JasperFillManager
    location: class JasperTest
    JasperPrint print = JasperFillManager.fillReport(fileName, hm, new JREmptyDataSource());
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:16: cannot find symbol
    symbol : class JRExporter
    location: class JasperTest
    JRExporter exporter = new JRPdfExporter();
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:16: cannot find symbol
    symbol : class JRPdfExporter
    location: class JasperTest
    JRExporter exporter = new JRPdfExporter();
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:19: cannot find symbol
    symbol : variable JRExporterParameter
    location: class JasperTest
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:20: cannot find symbol
    symbol : variable JRExporterParameter
    location: class JasperTest
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
    ^
    C:\Users\Dushantha\Desktop\a\JasperTest.java:25: cannot find symbol
    symbol : class JRException
    location: class JasperTest
    } catch (JRException e) {
    ^
    10 errors

    Process completed.


  • Actually I don't know what I want to do know. Please help me.
    Thank you.
     
    Bartender
    Posts: 2662
    19
    Netbeans IDE C++ Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi.

    The error tells you that the Jasper Reports libraries are missing from your classpath.
    I move this thread to our Other Open Source Projects forum, because you jave an issue with iReports, not with JDBC.
     
    dushantha Rathnayake
    Ranch Hand
    Posts: 103
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    Thank you very much ..

    Please tel me what I want to do know?
     
    Jan Cumps
    Bartender
    Posts: 2662
    19
    Netbeans IDE C++ Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Does this thread help you?

    Regards, Jan
     
    Ranch Hand
    Posts: 47
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You might need to include following jar files in your classpath.
    jasperreports-3.0.0.jar or whichever version you wish to include,
    commons-beanutils-1.8.0jar or whichever verion you wish to include ,
    commons-collections-3.2.jar or whichever verion you wish to include
    commons-digester-1.8.jar or whichever verion you wish to include
    commons-logging-1.1.1.jar. or whichever verion you wish to include

    Just google about it if you want different version. Also if you are using any building tools like ant or maven, you would need to include dependencies in your pom.xml. Following is for the maven. This is just for an example. You might need to amend as per your requirements.

    <dependency>
    <groupId>jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>3.5.3</version>
    </dependency>

    Best regards.
     
    Have you no shame? Have you no decency? Have you no tiny ad?
    Smokeless wood heat with a rocket mass heater
    https://woodheat.net
    reply
      Bookmark Topic Watch Topic
    • New Topic