Jump to content
Changes to the Jaspersoft community edition download ×

Image names in HTML export


Recommended Posts

By: Luc Feys - telenko28

Image names in HTML export

2005-03-21 05:14

I've been using Jasper reports for a few months now and I am really impressed with its ease of use, flexibility and functionality.

The only thing I keep feeling uncomfortable with is the location of images when using the HTML export to build a web page in a J2EE application.

 

Altough I think the use of an IMAGE_MAP in the user's session is a very clean solution to this problem, I feel it seriously lacks scaleability. If you have several images in a report the size of a user's session really explodes. I have an average session size of 5 to 10MB per user. This means my website will break down if I have up to 50 concurrent users who all use chart reports with 10+ images in each report (I only have 512MB available, which in my opinion should be sufficient for the type of application and expected user load of this particular web app).

 

On the other hand, putting the images in a directory on the server has several drawbacks too. First of all it will be slower than the IMAGE_MAP solution. Second, you need a place to store the images which might be a problem if you can only deploy compressed .ear files. Third (and biggest) problem: you need to have a way to distinguish between the images from different users or even different reports from 1 user.

 

Since (in my opinion) the scaleability issue with the IMAGE_MAP can not be resolved, I want to try to make the best of the IMAGES_DIR solution. But for this I would need a way to change the default name of the images (IMG_XX) to a name I can provide in my application. I was thinking of adding a IMAGE_NAME_PREFIX parameter to the JRHtmlExporter. The exporter would then create an image name based on that prefix (MY_PREFIX_XX). This would allow me to add for example the sessionId to the imagename, so I can distinguish between the images of different users. This way I can store all images in one directory on the webserver. The only thing left to do the is to clean up the images when the session is closed.

 

Does this seem like a good idea or does anyone have another suggestion to tackle the HTML images problem? I read in the interview with Teodor that he sees this as one of the top priorities for upcoming JasperReports versions. So maybe Teodor already has a solution for this problem is his head?

 

Thanks for any suggestions.

 

Luc Feys

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