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

phgaudin

Members
  • Posts

    7
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by phgaudin

  1. Hi, I just downloaded and installed iReport 4.5.0 and... it is really slow. I think the issue is due to memory usage because it is using much more memory than the 4.1.3. Philippe
  2. Hi Teodor, First of all, thanks for your reply /tools/fckeditor/editor/images/smiley/msn/wink_smile.gif ! I do not complain at all about the quality of the charts in PDF ! They are great when rendered in vectorial. My only issue is about charts in XLS, PPT,... which are rendered as bitmaps. The solution I found in the forum message I refered had a drawback : with that solution all charts are rendered as bitmaps, even when exported in PDF. The solution I suggested allows, from the same JasperPrint, to export the JasperPrint : to PDF as vectorial (with optimal quality), to XLS, PPT,... as bitmap with the possibility to change the "resolution" of the generated bitmaps (by changing a property)... so that you get best of both worlds ! I think that the code provided in the first message of this thread could be used as a - hopefully - good starting point... Kind regards, Phil
  3. Hi all, By default the quality of the rendered charts is too bad to be usable when a JasperReport is exported in XLS, PPT,... I found a possible solution in www.jasperforge.org/plugins/espforum/view.php but the problem with this solution is that all charts are rendered as bitmap images, even when exported to PDF. I needed a solution that allows the chart to be redered in : a "vector" format (ie DRAW) when exported to PDF a good quality bitmap when exported to XLS, PPT,...The solution I found (inspired by the one of rckrll106) is to enhance the getImageData() of the net.sf.jasperreports.engine.JRAbstractSvgRenderer class : public byte[] getImageData() throws JRException { Dimension2D dimension = getDimension(); if (dimension != null) { int imageDPI = JRProperties.getIntegerProperty("net.sf.jasperreports.svgrenderer.chart.dpi", 72); double scale = ((double) imageDPI) / 72d; byte imageType = getImageType(); BufferedImage bi = new BufferedImage( (int) (scale * dimension.getWidth()), (int) (scale * dimension.getHeight()), // avoid creating JPEG images with transparency that would result // in invalid image files for some viewers (browsers) (imageType == JRRenderable.IMAGE_TYPE_GIF || imageType == JRRenderable.IMAGE_TYPE_PNG) ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB ); Graphics2D g = createGraphics(bi); g.scale(scale, scale); Color backcolor = getBackcolor(); if (backcolor != null) { g.setColor(backcolor); g.fillRect(0, 0, (int) (scale * dimension.getWidth()), (int) (scale * dimension.getHeight())); } render(g, new Rectangle((int) dimension.getWidth(), (int) dimension.getHeight())); g.dispose(); return JRImageLoader.loadImageDataFromAWTImage(bi, getImageType()); } return null; } You can then change the quality of the rendered charts by adding - in the jasperreports.properties - the net.sf.jasperreports.svgrenderer.chart.dpi property and setting it to (for example) 200. What do you think about this solution ? Is there any chance to integrate it in one of the next releases of JasperReports ? Regards, Phil Post Edited by phgaudin at 05/25/2011 05:58
×
×
  • Create New...