Jump to content
Changes to the Jaspersoft community edition download ×

Export HTML : using images with style class


Recommended Posts

Hi All,

i would like to know if it's possible to export a report to HTML, setting a custom style class (css or other ) to a specific image.

In other words, i have several images in my report and i want to put a style when each of them considering some export html rules.


Thank you in advance,


Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic



In our current HTML exporter, we let users override the header of the resulting HTML output (HTML_HEADER exporter parameter).

This allows referencing custom CSS files.

However, you cannot reference a particular class in some of the image elements, and the CSS could only apply to all elements of the same type.


You could try implement your own HTML exporter, probably by reusing some of the code in the existing HTML exporter that we ship with JR.

But there will probably be a problem in locating those particular image elements for which you want to apply the style. There is no easy way to do that in a resulting JasperPrint object right now, as we do not preserve element keys in the generated document.



I hope this helps.


Link to comment
Share on other sites

  • 1 year later...

Hi folks,



Does anybody knows if this question about css was already solved at the latest versions of jasperreports/ireports? I'm in need to apply a style to let me show a field at the screen, but when I ask to print the html page, the button should not be printed.


If anybody have a clue to help me solve this problem, it could be wellcome.



Thiago Figueiredo

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