Unable to call .jrxml file from jsp

Ads
 

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

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
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
Advertisements
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
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
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
reading dropdown values from properties file in jsp
reading dropdown values from properties file in jsp  reading dropdown values from properties file in jsp
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 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
How to call servlet in JSP?
How to call servlet in JSP?  How to call servlet in JSP
how to display data from jsp file into database
how to display data from jsp file into database  this is a jsp file . look at the line with code-> Statement st=con.createStatement(); in the below example. the error is "cannot convert from java.sql.Statement
how read data from doc file in same formate in jsp
how read data from doc file in same formate in jsp  how we can read and display data on jsp page, from doc file with the same formatting
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
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data from excel file and update database using jsp Hi, I am using a MySQL database... upload excel file and update database using JSP ? Thanks in Advance
Calling from JSP
Calling from JSP  how can we call a class file from JSP   Hi, Do you want to call a servlet or a Java Bean through JSP? Please clarify this. For more information, visit the following link: JSP Tutorials Thanks
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
Getting Parameter from a css styled jsp file to a java servlet file...
Getting Parameter from a css styled jsp file to a java servlet file... ...; java servlet file-- /* * To change this template, choose Tools... is it not getting the parameter??? How do i accept the value in the servlet file
How to backup a selected file from the dropDown Menu in JSP?
How to backup a selected file from the dropDown Menu in JSP?  I am trying to create a dropdown menu list for some type of files contained ina... file into the backup directory. I need the jsp code that can generate
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
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 [email protected]
open pdf file in same jsp page and the pdf file should retrieved from database
open pdf file in same jsp page and the pdf file should retrieved from database  Hai all, I need code to open a pdf file in same jsp page(browser) while click on hyperlink And the file was located in database table. Can any
calling servlet from jsp
calling servlet from jsp  how to call a servlet from jsp
Data needs to be gathered in XML file from the database (MySql) using JSP
data regarding particular id from the database table. Data needs to be gathered in XML file from the database (MySql) using appropriate JSP/Java Bean functions...Data needs to be gathered in XML file from the database (MySql) using JSP 
The type Font is ambiguous where generating pdf file from jsp page - JSP-Servlet
The type Font is ambiguous where generating pdf file from jsp page  I am geeting ambiguous error .Do u want to add any jar files   Hi Friend, Import the class Font into your JSP page like the following
How display a image on servlet from file upload - JSP-Servlet
How display a image on servlet from file upload  Dear Sir, My issue is: How display a image on servlet from file upload I receive your answer today...: Unknown File Type From: localhost button - Find, Save, Cancel after clicking
JSP File
JSP File  Hi, What is JSP File? How to create JSP file? Thanks   Hi, JSP file is simple text file with .jsp extenstion. You can run JSP file on tomcat server. Read more at JSP tutorials section. Thanks
Passing a 2 Dimentional Array From one Jsp to Another Jsp file and Retreving it
Passing a 2 Dimentional Array From one Jsp to Another Jsp file and Retreving... are dynamically stored into it in one jsp file .I passed this array into another Jsp... JSP FILE 1 : // declatarion int final
iPhone Make Call from App
iPhone Make Call from App  iPhone Make Call Programmatically I have created an application in iPhone that has the functionality to make Call from App. I am just wondering how to make a call programmatically... is there any
web service call in jsp page
web service call in jsp page  I am wandering on internet for hours looking for a simple and good example on how to create a simple JSP page to call a web service when you have a WSDL. I am using tomcat web server and eclipse
jsp-file
jsp-file  i want to upload a file by browse button and the file should be save in ms access database.....how i can implement trough jsp plz help me sir

Ads