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









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
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
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 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
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
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
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
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 dll from java - JSP-Servlet
call dll from java  Hello all how to call dll file methods in java
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
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
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 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 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
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
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
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 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
How to write .properties file from jsp
to implement/write .properties file from jsp. Regards, Venkatesh Gurram.ADS...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
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
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
write to file from servlet - JSP-Servlet
write to file from servlet  Hi, I have a jsp file where I input... right data on the web site. I am also trying to write this data to file... JSP Page //<
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
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
how to generate the pdf file with scroolbar from jsp age - JSP-Servlet
how to generate the pdf file with scroolbar from jsp age  How to generate the pdf file with scroolbar from jsp.i am not able to see the all the columns in pdf file now .it is very urgent for me plz help
retrieving of value from excel file - JSP-Servlet
this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel...retrieving of value from excel file  Dear sir, Thanks for sending
retrieving of value from excel file - JSP-Servlet
this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel...retrieving of value from excel file  Dear sir, Thanks for sending
retrieving of value from excel file - JSP-Servlet
retrieving of value from excel file  Dear sir, Thanks for sending a code now i am getting a particular column value i.e EmailId column for snding a massmails,now i have to get a particular column values i.e Name(A),EL(B
How to call servlet in JSP?
How to call servlet in JSP?  How to call servlet in JSP
not able to get values from jsp file - JSP-Servlet
not able to get values from jsp file  hi thanks for u feedback, her am sending the file jsp and servlet but in the servlet file am not able to get... remove encrtype from form tag its work fine please go through the file
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
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 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
tomcat jsp call DLL
tomcat jsp call DLL  Where can i find Example of use JSP under Tomcat environment call DLL
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
Unable to run jsp files on internet explorer - JSP-Servlet
Unable to run jsp files on internet explorer  Hi, I am Akhilesh... checked alwz open jsp files with internet explorer from tht point onwards whnever i open a jsp file nothing gets loaded in the internet explorer and internet
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
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
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
how to create text file from jsp and provide downlode option
how to create text file from jsp and provide downlode option  HI... in java/j2ee tech. my question is who do i make a jsp output in the form of text file so that pepole can downlode that text file or may be some other file
Unable to run the jsp page - JSP-Servlet
Unable to run the jsp page  Expert:Naga Hi, I need solution this program. In cart.jsp I printed the total amount of the products then the next... with the date because when the admin want to display the details from particular date
File download from server to client machine - JSP-Servlet
File download from server to client machine  hi, I want to save a pdf file to my client machine from a button provoded in a jsp page.The file that was generated by jasper libraries.In my code i can give path for save
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 
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
How display a Image on servlet from file upload - JSP-Servlet
How display a Image on servlet from file upload  Dear Sir, I were ask a question that How display the Image on servlet through file upload. Today I... both jar file commons-fileupload-1.2.1.jar and commons-io-1.4.jar and set

Ads