aspose file tools*
The moose likes Other Open Source Projects and the fly likes create report with java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "create report with java" Watch "create report with java" New topic
Author

create report with java

dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
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.
    Jan Cumps
    Bartender

    Joined: Dec 20, 2006
    Posts: 2516
        
      10

    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.


    OCUP UML fundamental and ITIL foundation
    youtube channel
    dushantha Rathnayake
    Ranch Hand

    Joined: Feb 27, 2010
    Posts: 103
    Hi,

    Thank you very much ..

    Please tel me what I want to do know?
    Jan Cumps
    Bartender

    Joined: Dec 20, 2006
    Posts: 2516
        
      10

    Does this thread help you?

    Regards, Jan
    Rajubhai Kotwal
    Ranch Hand

    Joined: Nov 03, 2009
    Posts: 47
    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: create report with java