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

JasperReport new user. Need help please reply


chetan1989

Recommended Posts

I used the tutorial given on the page http://jasperforge.org//website/ireportwebsite/IR%20Website/ir_deploying_reports.html?header=project&target=ireport to deploy my report created using iReport (latest version) on java and included all the jars given on the page using one the project libraries. But I am getting the error

The java class is not found:  net.sf.jasperreports.engine.JRDataSource

 

I am using websphere 6.0 in RAD v7. I have kept all the jar files in Web-INF folder.

Please help me.

 

Thanks in advance :)

Code:
import net.sf.jasperreports.engine.*;import net.sf.jasperreports.engine.export.*;import java.util.*;			public class JasperTest {    public static void main(String[] args) {        String fileName = "C:/jrxml/report1.jasper";        String outFileName = "C:/report1.pdf";        HashMap hm = new HashMap();        try {            // Fill the report using an empty data source            JasperPrint print = JasperFillManager.fillReport(fileName, hm, new JREmptyDataSource());                        // Create a PDF exporter            JRExporter exporter = new JRPdfExporter();                        // Configure the exporter (set output file name and print object)            exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);            exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);                        // Export the PDF file            exporter.exportReport();                    } catch (JRException e) {            e.printStackTrace();            System.exit(1);        } catch (Exception e) {            e.printStackTrace();            System.exit(1);        }    }}
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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