Jump to content
Changes to the Jaspersoft community edition download ×

Does JR support CSS stylesheet for HTML

2005 IR Help

Recommended Posts

By: smeet - smeet

Does JR support CSS stylesheet for HTML

2004-08-11 08:17


I've been using Jasper Reports for 3 days now (with iReport GUI) and it appears to be quite powereful...

However, there is a point I haven't seen, and I'd like to know if JR supports it :

is it possible to design HTML reports using a CSS file for my graphic elements ? I did'nt find information about it. If you could answer and _ in the case it is supported _ give me some additional information_ I would be grateful.

Thank you all,

Damien ++





By: cosjav - cosjav

RE: Does JR support CSS stylesheet for HTML

2004-08-25 18:21

well?? does it support css?? I need to know too, because at work we are tossing up whether or not we should use jasperReports for html exporting.... if somehow we can get CSS support then we could use it....





By: Teodor Danciu - teodord

RE: Does JR support CSS stylesheet for HTML

2004-08-26 12:10




When exporting to HTML, JasperReports tries

to produce and output that would be as close

to PDF as possible.

Affecting this output through CSS does not make

sens as far as the default JasperReports HTML

exporter is concerned.


However, you could reference CSS resources if you

override some portions of the generated HTML using

the JRHtmlExporter parameters:





I hope this helps.








By: Mike Coxon - largesnike

RE: Does JR support CSS stylesheet for HTML

2004-08-31 00:39

I need to use the API for report generation for a portal site (i.e., differant clients see differant looks and feels), which means that the explicit declaration of colour in the design file is just *not* an option.


I'm contemplating extending all the Exporter classes to recognise .class style declarations in the .jrxml file. This means that the output colour shemes are based on structure and circumstance, rather than on element. Colours could still be supplied, but they would be ignored on html renderings.


Another approach is to add a step to report generation by perforing an XSLT translation from a primitive xml file to the jrxml file. In the primitive would be declared your styling context (like emphasis, strong, pageHeader, sectionHeader) and the translater would change the elements to hold the correct values following a lookup. The problem with this approach is that you still cannot provide all of the richness CSS can deliver. So while the rest of your site looks sophisticated, the report part ends up looking rather primitive.


Perhaps for a future version of JasperReports, we can get away from the need for explicit declaration.

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