calves1964 Posted September 26, 2006 Share Posted September 26, 2006 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 More sharing options...
dheffelfinger Posted September 26, 2006 Share Posted September 26, 2006 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. HeffelfingerAuthor: JasperReports For Java Developers Link to comment Share on other sites More sharing options...
calves1964 Posted September 28, 2006 Author Share Posted September 28, 2006 Thank you by your advice, the export work. Put only problem, doesn´t show inside thew browser.... Link to comment Share on other sites More sharing options...
dheffelfinger Posted September 28, 2006 Share Posted September 28, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now