Hi All,
i have written a code to run jrxml file from jsp page...
but im not able to run the report
please check my code -
-
-
<%@ page language="java" import="java.util.*,java.sql.Connection,java.sql.ResultSet,java.sql.Statement" %>
-
<%@ page import="java.sql.*,net.sf.jasperreports.view.JasperViewer,net.sf.jasperreports.engine.xml.JRXmlLoader,
-
net.sf.jasperreports.engine.JasperCompileManager,net.sf.jasperreports.engine.JasperFillManager,
-
net.sf.jasperreports.engine.JasperPrint,net.sf.jasperreports.engine.design.JasperDesign,
-
net.sf.jasperreports.engine.JasperReport"%>
-
<%@ page import="com.systeam.ms.DbDetails,java.sql.DriverManager"%>
-
-
-
<%!
-
Connection con;
-
ResultSet rs;
-
String query;
-
String ReportName;
-
String path="Reports/";
-
String ReportFile;
-
%>
-
-
<%
-
//response.setContentType("application/pdf");
-
try{
-
-
con=DbDetails.getConnection();
-
query="select distinct FILENAME from rpt_reportsform where
-
TITLE_LOC='Access Control Group/Forms'";
-
rs=DbDetails.getRS(query,con);
-
-
while(rs.next())
-
{
- //rs returns only single record here that is report1.jrxml
-
-
String ReportName = rs.getString("FILENAME");
- //here the ReportFile returns the string Reports/report1.jrxml.
- concatination is needed since Reports folder contains report1.jrxml file
-
ReportFile=path.concat(ReportName);
-
}
-
-
try{
-
-
JasperDesign jasperDesign = JRXmlLoader.load(ReportFile);
-
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
-
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null,con);
-
System.out.println("run");
-
JasperViewer.viewReport(jasperPrint);
-
//response.sendRedirect(ReportFile);
-
}
-
catch(Exception ex) {
-
String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
-
out.println(connectMsg);
-
-
}
-
}}
-
catch(Exception e)
-
{
-
out.print(e);
-
}
-
-
%>
-
-
-
im not able to run that jrxml file. control is going to catch block since it is not taking the specified jrxml file path.
my application structure is like this
MSReports
|
V
pages
WEB-INF
Reports
|
V
report1.jrxml
report2.jrxml
can anybody help me please
0 5556 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: matt |
last post by:
I have compiled some code, some written by me, some compiled from
various sources online, and basically i've got a very simple flat file
photo gallery. An upload form, to upload the photos and give them a
caption, storing the caption and filename in a text file. It's a bit
buggy when removing the photos and captions from the file, and also in
displaying them on the delete page. you can see it in action at
www.4am.com.au/gallery/upload.php...
|
by: Dave Smithz |
last post by:
Hi There,
I have a PHP script that sends an email with attachment and works great when
provided the path to the file to send.
However this file needs to be on the same server as the script.
I want to develop a webpage where people can send attachments that are
stored on their local PC.
|
by: Joseph |
last post by:
Hi,
I'm having bit of questions on recursive pointer. I have following
code that supports upto 8K files but when i do a file like 12K i get a
segment fault. I Know it is in this line of code. How do i make the
last pointer in the indirect sector that has another level of indirect
pointer, and be defined recursively to support infinite large files?
-code-
|
by: StGo |
last post by:
How can i read/write file's custom attributs(like subject,author...) in
C#???
Thanks :))
|
by: Lokkju |
last post by:
I am pretty much lost here - I am trying to create a managed c++
wrapper for this dll, so that I can use it from c#/vb.net, however, it
does not conform to any standard style of coding I have seen. It is
almost like it is trying to implement it's own COM interfaces...
below is the header, and a link to the dll+code:
Zip file with header, example, and DLL:...
| |
by: Sky Sigal |
last post by:
I have created an IHttpHandler that waits for uploads as attachments for a
webmail interface, and saves it to a directory that is defined in
config.xml.
My question is the following:
assuming that this is suppossed to end up as a component for others to use,
and therefore I do NOT have access to their global.cs::Session_End()
how do I cleanup files that were uploaded -- but obviously left stranded
when the users aborted/gave up writting...
|
by: shanmukhi |
last post by:
hi All,
i got a problem while running jrxml file from jsp page.
i have written code to compile jrxml file, run the file and export to pdf.
the code is running fine, pdf file is also generating...but pdf is not displaying while sending the request, it is not taking the path of pdf file...
i have given exact path.....but it is not taking....
i tried in somany ways but no use.......
please help me..i need it urgent.
here is my code of jsp
|
by: Akino877 |
last post by:
Hello,
If I have a .jrxml file, how do I compile it into a .jasper file? Could you please give a me instructions to do this?
Thank you for your help.
Akino.
|
by: Sundhas |
last post by:
Hey! I am working on jrxml to create dynamic re0ports. I have parameterized the columns i.e. the jrxml for that report can be used to generate other reports as well.
However, i have not managed to make the fields flexible. That is, if the user selects 4 columns it would work but if 1 or 2 or 3 columns are selected, it gives an error since the field names are unidentified.
Please post a solution urgently if something like a default...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |