Jump to content

How can use JasperViewer on Web


calves1964

Recommended Posts

I created one report with JasperViewr on my Servlet class, but the preview show on the side of server not of client. How i can do to show the preview report on the side client.?????

I need a rtf report (word), then for me. I can´t use adobe pdf to show on the side of client..

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

To export your report to RTF and export it to the browser you need to use the JRRtfExporter class.

 

The following code fragment should give you an idea on how to proceed:

 

Code:

.
.
.
JRRtfExporter exporter = new JRRtfExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());

exporter.exportReport();
.
.
.

 

 

This code will stream the report as an RTF to the browser.

 

The code assumes you have access to the HttpServletResponse instance, and your variable is called response.

 

It also assumes the report has already been filled and it is stored in an object called jasperPrint (an instance of net.sf.jasperreports.engine.JasperPrint).

 

Hope that helps.

 

David R. Heffelfinger

Author: JasperReports For Java Developers

Link to comment
Share on other sites

There is no way to programmatically make the RTF document show up embedded in your browser.

 

Your users may have to configure their browsers so that the RTF document shows up embedded in the browser.

 

I believe that if the users are using Internet Explorer and have MS Word installed, the RTF will show up embedded in the browser.

 

I'm not sure on how to accomplish this using other browsers.

 

David

Link to comment
Share on other sites

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