sathwikh Posted January 1, 2010 Share Posted January 1, 2010 Hello,I have a problem in embeding jasper into jsp.It is giving FileNotFound exception even though i hv given the correct path of jasper filePlease HELP ME please!! Thank u very much!Code:<%@ page language="java" import="java.sql.*"%><%@ page import="java.util.HashMap"%><%@ page import="java.util.*"%><%@ page import="net.sf.jasperreports.engine.*"%><%@ page import="java.io.*"%><%@ page import="java.sql.*"%><%@ page import="net.sf.jasperreports.view.*"%><%@ page import="net.sf.jasperreports.view.save.*"%><%Connection connection = null;String jasperFile = "./report-src/list_users.jasper";String pdfFile = "./report-fnl/list.pdf";HashMap<String,Integer> params = new HashMap<String,Integer>();params.put("p_id", 30);System.out.println("The context path is >>>>>>>>>> " + request.getContextPath());try {Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();connection = DriverManager.getConnection("jdbc:db2://localhost:50000/OLIMS", "db2admin","admin");JasperPrint print = JasperFillManager.fillReport(jasperFile, params,connection);JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,pdfFile);exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);exporter.exportReport();System.out.println("Created file: " + pdfFile);} catch (Exception e) {e.printStackTrace();} %> Link to comment Share on other sites More sharing options...
Teodor Danciu Posted January 20, 2010 Share Posted January 20, 2010 Hi, Next time post the entier stack trace of the exception, if you want quicker/better answers.Consider looking into the Web application sample found in the /demo/samples/webapp folder of the JR project source package. Thanks,Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now