Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Unable to call .jrxml file from jsp

Ads

 
 

Share on Google+Share on Google+

Ganesh D Ganbote
Unable to call .jrxml file from jsp
0 Answer(s)      6 years and 6 months ago
Posted in : JSP-Servlet

Hi, I am doing web application in jsp. To create report I have used ireport and interated with neatbeans using plugin. After creating report in netbean when i call that jrxml file then it unable to access it.Error also not showing. I will show my code and its output. Please refer to it and suggest what changes need to be done. The is as Follows: **In Report.jsp file*****

<%@page import="net.sf.jasperreports.engine.util.JRLoader"%> <%@page import="net.sf.jasperreports.view.JasperViewer"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="database.database_connection" %> <%@page import= "java.io.IOException;"%> <%@page import ="java.io.PrintWriter;"%> <%@page import ="java.io.StringWriter;"%> <%@page import= "java.util.HashMap;"%> <%@page import=" java.util.Map;"%> <%@page import=" java.sql.*;"%> <%@page import="database.CollectionDataSource"%> <%@page import=" javax.servlet.ServletException;"%> <%@page import=" javax.servlet.ServletOutputStream;"%> <%@page import=" javax.servlet.http.HttpServlet;"%> <%@page import=" javax.servlet.http.HttpServletRequest;"%> <%@page import=" javax.servlet.http.HttpServletResponse;"%> <%@page import=" net.sf.jasperreports.engine.*;"%> <%@page import=" net.sf.jasperreports.engine.design.JasperDesign;"%> <%@page import=" net.sf.jasperreports.engine.xml.JRXmlLoader;"%> <%@page import=" net.sf.jasperreports.engine.export.*;"%> <%@page import="database.database_connection" %>

<%@ page import="java.util.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <%@ page import="java.text.*" %> JSP Page

          <%
          ResultSet rsOfIncident = null;
       try {
                database_connection db1=new database_connection();
                if(db1.ConnectionStatus())
                 {

                      rsOfIncident =db1.getExecute("Select * from Incident");

                    }
                   db1.Close();
                 }
                catch(Exception e1)
                {
                }
    %>

             <%

Connection conn = null; JasperReport jasperReport; JasperPrint jasperPrint; JasperDesign jasperDesign; try { String connectionURL = "jdbc:mysql://localhost:3306/ticketingtool"; Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection(connectionURL,"root",""); JRDataSource dataSource = new JRResultSetDataSource(rsOfIncident);

// create a map of parameters to pass to the report. Map parameters = new HashMap(); parameters.put("IncidentID", "FirstName"); jasperDesign = JRXmlLoader.load("E:/GRS/6th BacUp/ticketingtool/web/report2.jrxml"); jasperReport = JasperCompileManager.compileReport(jasperDesign);

// fill JasperPrint using fillReport() method jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,dataSource);

JasperExportManager.exportReportToPdfFile(jasperPrint,"C:/demo.pdf"); response.setContentType("report2.jrxml"); JasperViewer.viewReport(jasperPrint); } catch(SQLException sqle) { System.err.println(sqle.getMessage()); } catch (ClassNotFoundException e) { System.err.println("No such class found!"); } catch (JRException e) { // display stack trace in the browser StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); response.setContentType("text/plain"); } finally { //close the connection. if(conn != null) { try { conn.close(); } catch (Exception ignored) {} } } %>

             <table>
                 <tr>
                     <td>
                         Hello
                     </td>
                 </tr>
             </table>
   </form>
</body>

***And it output**** Here output display in browser.

JSP Page

             <table>
                 <tr>
                     <td>
                         Helo
                     </td>
                 </tr>
             </table>
   </form>
</body>

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Unable to call .jrxml file from jsp
Unable to call .jrxml file from jsp  Hi, I am doing web application in jsp. To create report I have used ireport and interated with neatbeans using plugin. After creating report in netbean when i call that jrxml file
To call jrxml/jasper file through jsp code in netbean
To call jrxml/jasper file through jsp code in netbean  I am making... my question is I want to call that jasper file through my jsp code and i also... suggest me some code to call jasper file and to send dynamic querry
Advertisements
How to Display jrxml file on JSP page???
How to Display jrxml file on JSP page???  I made jrxml file using jasper report but how to display on jsp page?? i tried lot but still i didnt find out solution.so pls help me as soon as possible
jrxml in Jsp prntviewer
jrxml in Jsp prntviewer  Hi this is Mohan, I'm new to ireport. I have a requirement. I want to view jrxml in jsp. I was searching in google for few days but could not find the correct solution. My actual problem is that i dont
how to call jsp from flex
how to call jsp from flex  hi, i want to know that how can i call a FLEX from JSP. . A good Example will be appreciated
how to call jsp from flex
how to call jsp from flex  Plz help me out to get JSP from FLEX.... I need your help.... Thanks for future
unable to compile class file - JSP-Servlet
unable to compile class file  I wrote database connection in jsp file... * from Combolist"); List ulist = new ArrayList(); List clist = new ArrayList...("/jsp/Combobox.jsp"); dispatcher.forward(request, response
call dll from java - JSP-Servlet
call dll from java  Hello all how to call dll file methods in java
How to call jasper from jsp or servlet - JSP-Servlet
How to call jasper from jsp or servlet  Hi Expert , I created jasper report using ireport.how to call that jasper with jsp file or servlet file ? Thanks in advance Eswaramoorthy.s
Call servlet from javascript - JSP-Servlet
Call servlet from javascript  Hi in my application i have jsp... , in my jsp i have provided an upload button thet upload single column excel file... form in jsp file is Upload plot nos (.xls format
Call dll from java - JSP-Servlet
Call dll from java  Any one tell me how to call dll from java. Basically , i want read the cash m/c parameters(4,i.e i want to read the cash count) in java .For this i want to call a dll from java . Also any one have
Unable to bind to a hashmap from jsp using spring tags - Spring
Unable to bind to a hashmap from jsp using spring tags  Hi, I am unable to bind a hashmap from my jsp page. Here is what i want to do: I have an arraylist in a jsp page. As i loop through the array list, for each element i
Diff ways to call a EJB from Servlet, JSP - Java Interview Questions
Diff ways to call a EJB from Servlet, JSP  How can I call EJB from Servlet or JSP
how to call an exe file from java - Java Beginners
how to call an exe file from java  hi, how to call exe file with some parameters from java and save the output of the exe file in a specified path. Please let me know immediately..its urgent!!! Thanks in advance
Unable to execute JSP page
Unable to execute JSP page  I have written one jsp file. It contains html tags and jsp directives. I have saved the file with the extension .jsp. The tomcat server is already running onto my machine. I have saved the jsp file
how call ireports in jsp
ireports in servlet-jsp program i am trying to call the ireports in servlet and jsp...: java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable...: java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable
Unable to compile class for JSP - WebSevices
Unable to compile class for JSP  org.apache.jasper.JasperException: Unable to compile class for JSP When I am trying to access a java file kept under src folder under a package from a jsp page placed under web directory, I am
unable to connect to server - JSP-Servlet
, create a web application folder inside the webapps folder and put the jsp file...unable to connect to server  thank you for the program code for inserting and reteriving the image but i am unable to deploy these two programs
error got minus one from read call - JSP-Servlet
minus one from a read call oracle.jdbc.dbaccess.DBError.throwSqlException...error got minus one from read call  hiiii while connecting my servlet...) the code is as follows: // *DataBase Connectivity from the Servlet. import
call ireports
call ireports  how to call jrxml file in jsp or servlets pls give one example any one? please send one example any one
callig jsp file from javascript function - JSP-Servlet
callig jsp file from javascript function  I want to call a jsp file... data, no button and no links. Is it possible to call jsp page from static html... to call either jsp pge or html page from one html form. even u dont need to open
reading dropdown values from properties file in jsp
reading dropdown values from properties file in jsp  reading dropdown values from properties file in jsp
How to call servlet in JSP?
How to call servlet in JSP?  How to call servlet in JSP
unable to get datas from oracle database
unable to get datas from oracle database  Dear Sir, I am again... this error when i run the jsp file in tomcat, I post my code below.. kindly let me... org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred
call from java - JavaMail
call from java  Hi, how i will call servlet from java.. plz its... the java.net package to call a servlet from the java code...(); } } -------------------------------------------   Servlet and JSP Examples
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..  I have a class file AbstractDataAccessObject with the below code... max("+pkid+") from "+tableName); if(rs.next
tomcat jsp call DLL
tomcat jsp call DLL  Where can i find Example of use JSP under Tomcat environment call DLL
How to write .properties file from jsp
to implement/write .properties file from jsp. Regards, Venkatesh Gurram...How to write .properties file from jsp  Hi i new to java i stuck here... it in my jsp but Iam unble to modify/write the .properties file and Iam not getting
a trigger to call .bat file oracle
a trigger to call .bat file oracle   hey,pls help mei want to know that can we call java/.bat file from plsql/proceudre /trigger   ... java/.bat file from plsql/proceudre /trigger mdakbark@gmail.com
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page  I have a .properties file. I have to create a jsp page such that it reads the data from this .properties file and display it in table format. Ex:by using
Read Text file from Javascript - JSP-Servlet
Read Text file from Javascript  plz send the code How to Retrieve the data from .txt file thru Javascript? And how to find the perticular words in that file