Jump to content
We've recently updated our Privacy Statement, available here ×

re: Jasper error


2005 IR Help

Recommended Posts

By: Chris Bliesner - cpb8359

re: Jasper error

2004-05-26 13:57

Hi--Trying to Load a Jasper Report and get the following message, any ideas? :

 

package jaspertest;

 

import javax.servlet.*;

import javax.servlet.http.*;

import java.io.*;

import dori.jasper.engine.*;

 

 

 

 

/**

* Outputs the PDF to a browser.

* Requires that the report has already been generated and filled.

* @param the http request

* @param the http response

* @param a description of the report, contains downloadType, name etc.

* @return can be ignored at this time

*/

 

 

 

public class rptnew extends HttpServlet

{

public void doGet(HttpServletRequest req,

HttpServletResponse resp)

throws ServletException, IOException, JRException

{

try{

// boolean success = false;

ServletOutputStream out = resp.getOutputStream();

resp.setContentType("application/pdf");

 

JasperManager.loadReport("Test");

// JasperExportManager.exportReportToPdfStream("Test", out);

// success = true;

}

catch (JRException e) {

e.printStackTrace();

}

 

catch (IOException e)

{

e.printStackTrace();

}

 

// return success;

}

 

public void doPost(HttpServletRequest req,

HttpServletResponse resp)

throws IOException, ServletException

{

doGet(req, resp);

}

 

 

}

"rptnew.java" 57 lines, 1395 characters

epdata02_bliesncp> cd ..

epdata02_bliesncp> javac jaspertest/rptnew.java

jaspertest/rptnew.java:24: doGet(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) in jaspertest.rptnew cannot override doGet(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) in javax.servlet.http.HttpServlet; overridden method does not throw dori.jasper.engine.JRException

public void doGet(HttpServletRequest req,

^

1 error

 

 

 

 

By: Gregory A. Swarthout - gswarthout

re: Jasper error

2004-05-26 14:33

This error doesn't have anything to do with jasper. You are trying to override the doGet method but also have it throw a new kind of error that wasn't declared in the superclass. You can't do that. You'll need to wrap your JasperException in a ServletException in order to throw it.

 

 

 

 

By: Chris Bliesner - cpb8359

re: Jasper error

2004-05-26 14:49

Thanks, it loaded...now, my understanding is that class file will be created after the Load and then I need to fill the report using the class name??

 

 

 

 

By: Gregory A. Swarthout - gswarthout

re: Jasper error

2004-05-26 14:55

I think you need to read the docs more. This is all covered in the purcased manual, and maybe in the online tutorial as well. Looking at the samples provided will help you out, too.

 

 

 

 

By: Chris Bliesner - cpb8359

re: Jasper error

2004-05-26 15:06

it looks like I should be expecting a report.jasper file after it is loaded but I don't have one. What's up?

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...