ameet.au Posted June 4, 2007 Share Posted June 4, 2007 How to generate jasper report on HTML when one image loaded from database and for the other we give a image pathMy codeByteArrayOutputStream baos = new ByteArrayOutputStream();exporter = new JRHtmlExporter();exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); exporter.exportReport();byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();I am able to work this in PDF(image from Database and another stored in the webserver) using byte image[] =(byte[]) outData.get("image");ByteArrayInputStream img = new ByteArrayInputStream(image);hmimg.put("P_PARAMV3", img);print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);bdata= JasperExportManager.exportReportToPdf(print); Can any one help plsPost edited by: ameet.au, at: 2007/06/04 10:52 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