473,750 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ireports in jsp

58 New Member
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 1309

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

Similar topics

1
2470
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 done. All the msdn documentation seems to use managed code. Where can I find decent documentation or examples on exporting using the IReports interface? Thanks
47
3544
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 asking for personal opinions on which is the *best* language :) Alan.
0
2508
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 don't work nearly as well as they should, even for analysts and power users. The reason they haven't reached the masses is because most of the tools are so difficult to use and reveal so little
0
5899
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
2025
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 to build a dynamic SQL query and the subsequent results will be used to fill the report for the chosen columns. The application being used in WebSphere Portals. Though my search in google for the same gave many tools like JasperReports,...
20
8330
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 Documents on a server from Word templates and injecting data from a data source. There are a number of solutions to this problem that are less than satisfactory: 1. Use the Microsoft Word Object Model is not good as it requires the installation of a...
10
10594
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 OtherTables table. I want to select from a table whose tableID is stored in the OtherTables table. I have the ID of the OtherTables row that contains this table that I want to select from. I hope this is possible and that someone would be able to help...
2
4010
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
1364
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 developing the following.. - Creating charts in Java - Creating webservice programs (application server) - Creating reports in Java ofcourse the topics above should be developed using the Eclipse IDE. In webservice... i used to...
0
9575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.