Jump to content
JasperReports Library 7.0 is now available ×

getting bytes  


Recommended Posts

By: Stefano Maxis - stefano_maxis

getting bytes Â

2006-01-12 06:48

Does anyone know how to get bytes from an html created with jasperreport without writing the file?Â

I mean, there is "JasperRunManager.runReportToPdf(jasperReport, new HashMap(), getConnection());" or "JasperExportManager.exportReportToPdf(jasperPrint);" for pdf and i need the same for html, but i don't know which method i can use (if it exist).Â

Â

thanks Â

Stefano

 

 

 

 

By: Sanjeev - point1by0

RE: getting bytes Â

2006-01-12 07:22

Hi, Â

Â

You could use JRHtmlExporter as: Â

Â

JRExporter exporter = new JRHtmlExporter(); Â

ByteArrayOutputStream baos = new ByteArrayOutputStream(); Â

byte[] bytes = null; Â

Â

// Set the Jasper print obj. to export Â

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); Â

// Set the output stream to export to Â

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); Â

// Set additional parameters if required Â

Â

exporter.exportReport(); Â

bytes = baos.toByteArray(); Â

Â

Hope this helps, Â

-SanjeevÂ

 

 

 

 

By: Thomas Ludwig Kast - tomkast

RE: getting bytes Â

2006-01-12 09:19

have a look at:Â

Â

jasperreportsdemosampleswebappWEB-INFclassesservletsPdfServlet.java

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