Jump to content
Changes to the Jaspersoft community edition download ×

My report doesn't show up from servlet

2005 IR Help

Recommended Posts

By: Christianto Sahat - csahat

My report doesn't show up from servlet

2004-12-21 18:50

Hi all,


I have a problem with Jasper report. I've already

design the report using iReport. The report is

just a simple static text. It was already

compile successfully, and I could view using

iReport viewer. But when I tried to run it

from servlet, there's only blank pdf page,

and there's no static text I've written. There

was no error when I tried to debug the code.

What's wrong ? This is snippet of my

source code :


try {

ServletContext context = this.getServletConfig().getServletContext();



context.getRealPath("/WEB-INF/lib/jasperreports-0.5.3.jar") +

System.getProperty("path.separator") +









byte[] bytes = null;

try {

File reportFile = new File(context.getRealPath(


Map parameters = new HashMap();

parameters.put("TWORKORDER_PK", "1");



bytes = JasperRunManager.runReportToPdf(reportFile.getPath(),

parameters, new ConnectionFactory().getConnection());


if (bytes != null && bytes.length > 0) {



ServletOutputStream ouputStream = httpServletResponse.getOutputStream();

ouputStream.write(bytes, 0, bytes.length);






catch (JRException e) {





catch (IOException ie) {










By: Alexander Wallace - aows

RE: My report doesn't show up from servlet

2004-12-22 20:01

are you using IE and pdf viewer embedded in broser? Try saving the link instead and see if the report works, there is a bug in IE/pdf in certanin situations

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...