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

images scaling in Excel


Recommended Posts

By: dotimin - dotimin

images scaling in Excel

2006-07-12 02:10

Hi, in my report I have several images and charts. I try to export a report to Excel (JExcelApi)format. Export works but all images and charts are shown with bad quality (if I export the same report to PDF I get excellent quality. Also I noticed that all images are scaled (about 133%). This is not what I need to get..

Do you know any solutions for that?

Thanks!

Link to comment
Share on other sites

  • 1 year later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hey Everyone,

 

I am seeing this same behavior in both RTF and Excel. What I've been able to discern is that the sizes are correct coming out of jasperreports, but by the time the resulting file is opened by Word or Excel, the row heights and widths have all been slightly increased. The images are correctly expanded to fill the space, but the resolution is obviously compromised.

 

My current solution is to create my own JRImageRenderer objects with images scaled by 1.33x1.33 for RTF, and 1.33x1.18. I had to modify JExcelApiExporter to leave the image alone if it's a BufferedImage provided by a JRImageRenderer. Then both Word and Excel correctly expand the image to the pixel-perfect size.

 

This solution is a hack, although it fortunately does appear to work in both Excel and OpenOffice. I would really like to have a more generic solution if possible.

 

Anyone else have any more information on this issue?

 

Thanks,

Scott

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