473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

ireports in jsp

Hi All,
can anybody tell me how to run ireports(jrxml file) from jsp page.
i tried a lot...but no way..
but it is urgent for me please help me
i tried like this...
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@ page language="java" import="java.util.*,java.sql.Connection,java.sql.ResultSet,java.sql.Statement" %>
  3. <%@ page import="java.sql.*,net.sf.jasperreports.view.JasperViewer,net.sf.jasperreports.engine.xml.JRXmlLoader,
  4.  net.sf.jasperreports.engine.JasperCompileManager,net.sf.jasperreports.engine.JasperFillManager,
  5.  net.sf.jasperreports.engine.JasperPrint,net.sf.jasperreports.engine.design.JasperDesign,
  6.  net.sf.jasperreports.engine.JasperReport"%>
  7. <%@ page import="com.ms.DbDetails,java.sql.DriverManager"%>
  8.  
  9. <%!
  10. Connection con;
  11. ResultSet rs;
  12. String query;
  13. String ReportName;
  14. String ReportFile;
  15. %>
  16.  
  17. <%
  18.  response.setContentType("application/pdf"); 
  19. try{
  20.  
  21. con=DbDetails.getConnection(); 
  22. query="select distinct FILENAME  from rpt_reportsform_j";
  23. rs=DbDetails.getRS(query,con);
  24.  
  25. while(rs.next())
  26. {
  27. String report = rs.getString("FILENAME");
  28. }
  29.  
  30. try{
  31.  
  32. JasperDesign jasperDesign = JRXmlLoader.load("Reports/ADMINGroupFields.jrxml");
  33. JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
  34. JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null,con);
  35. JasperViewer.viewReport(jasperPrint);  
  36.  
  37.       }
  38.       catch(Exception ex) {
  39.          String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
  40.          out.println(connectMsg);
  41.  
  42.    }
  43.  
  44. }
  45. catch(Exception e)
  46. {
  47.     out.print(e);
  48. }  
  49.  
  50. %>
  51.  
  52.  
here for jdbc connection i have written java class and called..
no problem with my class it is working very fine.,,,,

im getting problem as file not found...
the report file i specified is exactly at the specified location
i tried with normal java class...this code is working fine and im getting report also but in jsp it is not working...

please can anybody help i needed it urgently
Jul 12 '07 #1
0 1300

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jason | last post by:
Hello, I am trying to implement exporting of a crystal report to be saved in MS Excel format from a C++ application. I can't seem to find any decent documentation or examples on how this can be...
47
by: Alan Brown | last post by:
As a newbie I would like to ask what the difference in application (not details) is between C++ and Java. In what situations would you use C++ in preference to Java and vice versa? I am not...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
0
by: shweta gandhi | last post by:
hi, i m new to iReports & want to create charts in iReports. if anyone knows plz. help me. its very urgent. thanks in advance.
0
by: itsraghz | last post by:
Hello people, My present project need is to have an Open Source Java based reporting tool, which would allow the users to customize the fields to be chosen at runtime. The chosen fields are used...
20
MMcCarthy
by: MMcCarthy | last post by:
This problem was proposed to me but not really my area of expertise so I thought I would open it up to the forum to see if anyone had any bright ideas. The problem is generating Microsoft Word...
10
by: r035198x | last post by:
Hi Oracle experts, I have a table called, say, OtherTables which stores IDs of other tables and their respective table names. OtherTables(ID, tableID, tableName) ID is the key of the...
2
by: mangalamonkey | last post by:
I want to export data into an excel file using iReports.I could do that but the data is displayed as an image. I need the data to be displayed as cells as in the excel sheet. plz do reply.........
3
jeffbroodwar
by: jeffbroodwar | last post by:
Hello everyone, I used to create java programs using netbeans IDE. I decided to try eclipse since a lot of java programmers recommend using it. I wanna know what programs do you recommend in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.