Jump to content
Changes to the Jaspersoft community edition download ×

Is it possible to reomve the 'style' settings in each field in an HTML report?


matthew.harrison
Go to solution Solved by marianol,

Recommended Posts

I've been using Jasper Reports 6.1.0 to produce reports, and its generally going quite well.  One issue I've hit is that when we produce HTML reports with quite a few results the HTML page that gets generated is too big to open in IE (effectively).  It will just about open in Chrome, but that's not the target here.

I think the issue is that each cell in the report gets its own 'style=...' attribute.  Whilst I can understand that this gives full control over the display in the report, in my case its making the HTML rather large - and the report layout in this case is a very simple grid.  Is there any way that styles can be set externally (CSS), and/or the 'style=...' attribute can be suppressed?  Or any ideas on how I might reduce the amount of style settings used?

Thanks in advance,

Matt

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Short of customizing the HTML exporter I'm not sure... 

Here are some things to try (I have not tried) use accessible HTML that may clean up the HTML http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.html.accessible

You can also try using one of the old HTML exporters, go to jasperreports.properties file (webapps/jasperserver[-pro]/WEB-INF/classes)
search for the text below and try them out 

# switch between new XHTML and the former HTML exporter
com.jaspersoft.jasperreports.export.html.type=html2
#com.jaspersoft.jasperreports.export.html.type=xhtml
#com.jaspersoft.jasperreports.export.html.type=html
Link to comment
Share on other sites

Hmm, ok.  I had a little look at the HTML exporter, and made some changes so that when it found a new style it created a class, and added a style into the page, and then used that style further on in the page.  This reduced my 138Mb report down to 73Mb - still too big for us, but anyway. What we've ended up doing is pointing the users to other renditions by default.

The changes I made do seem to produce a large reduction in the HTML size (although I think to really cut it down you would need to do something more drastic to the page).  Would it be something of interest for me to contribute back? (if so could you point me to the getting started point for contributions?)

Cheers,

Matt

 

 

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