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

Directing the jasper charts to Browser


saradhasivaraman

Recommended Posts

Hi ,

I have used serlvet to direct the jasper chart to Browser... Here is the snippet for the same...

web.xml

 

 <servlet>
    <servlet-name>webreport</servlet-name>
    <servlet-class>
      net.ensode.jasperbook.HtmlReportServlet
    </servlet-class>
  </servlet>
  <servlet>
    <servlet-name>ImageServlet</servlet-name>
    <servlet-class>
      net.sf.jasperreports.j2ee.servlets.ImageServlet
    </servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>webreport</servlet-name>
    <url-pattern>/webreport</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ImageServlet</servlet-name>
    <url-pattern>/image</url-pattern>
  </servlet-mapping>
 and I use JRHtmlExporter in my HtmlReportServlet class to direct it to the browser
 
JRHtmlExporter htmlExporter = new JRHtmlExporter();
      response.setContentType("text/html");
      request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_
                                PRINT_SESSION_ATTRIBUTE, jasperPrint);
      htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT,
                                jasperPrint);
      htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER,
                                printWriter);
      htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,
                                "image?image=");
      htmlExporter.exportReport();
 
I face the problem while deploying the weblogic sever... It throws runtime classnotfound exception  net.sf.jasperreports.j2ee.servlets.ImageServlet

 

  net.sf.jasperreports.j2ee.servlets.ImageServlet this class is avialable under the jar jasper reports 4.5

 <servlet-class>

      net.sf.jasperreports.j2ee.servlets.ImageServlet
    </servlet-class>

 

Can U Guys plz help me..

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

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