Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Customer Requirements for Developers
this week in the
Joined: Aug 24, 2004
Aug 24, 2004 05:52:00
I am attempt to print a report.jasper from
file but it is print a blank page
below is the code. can anybody help me?
<%@ page import="dori.jasper.engine.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
File reportFile = new File(application.getRealPath("/reports/facture/Page1.jasper"));
File imageFile = new File(application.getRealPath("/images"));
Map parameters = new
byte bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, new JREmptyDataSource(1));
ouputStream = response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
[ August 24, 2004: Message edited by: Bear Bibeault ]
Joined: Aug 14, 2001
Aug 24, 2004 06:00:00
One suggestion, have you tried writing the byte array to file instead of the browser to see whether the PDF looks OK?
SCJP 1.4, www.gsi3d.org.uk
Joined: Nov 08, 2001
Aug 24, 2004 06:20:00
We have hundreds of posts every day and by marking you title as URGENT does not help you out. If you want to get any help, you should make your title more descriptive. Many people when they see the word URGENT in a post, they tend to ignore it.
Author and all-around good cowpoke
Joined: Mar 22, 2000
Aug 24, 2004 06:57:00
You should be sending a PDF file from a
, not a JSP. JSP are designed to write characters streams.
Author and ninkuma
Joined: Jan 10, 2002
Aug 24, 2004 08:09:00
As William said, JSP is a poor technology choice for non-text responses. And as Eric said, URGENT is a poor choice for a topic title. I have edited the title accordingly.
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: Blank page
file .jasper and jsp
JasperReports + JSP
("application/pdf") in websphere 4.0.3
about jasperreport export pdf doc
JSP and iReports without database connection
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015