2

I am trying to convert JRXML to HTML where I am displaying a long list of items. But I need the background image to stretch till the end of the html. But it seems like the max size of the background band height could only be 612. But the total length of my page is exceeding that. Also I have set the Ignore Pagination of the report to true.

Could anybody please help me with the same?

user3115056
  • 1,266
  • 1
  • 10
  • 25
  • Hi Petter, I just removed the middle section of the background and added it to the detail section.... Although after that also I needed to put some html improvizations since I was having a gap after every detail section. Let me know if you are facing the same issue then will post the fixes that were done on html – user3115056 Aug 17 '16 at 18:25
  • Consider to post an answer or accept the current answer, to close this question – Petter Friberg Aug 26 '16 at 22:55

1 Answers1

0

If you only need it for the html export I would go for a personalized style sheet

To set style sheet (css), you can set the header in the SimpleHtmlExporterConfiguration, that is passed to the HtmlExporter

Example

HtmlExporter htmlExporter = new HtmlExporter();
.. set print and and output.            
SimpleHtmlExporterConfiguration config = new SimpleHtmlExporterConfiguration();
config.setHtmlHeader("<html><head><title>Your title</title><link rel=\"stylesheet\" type=\"text/css\" href=\"css/my.css\" /></head><body>");
htmlExporter.setConfiguration(config);

For the css to stretch the background image see:

How do I stretch a background image to cover the entire HTML element?

css, example copied from this answer

html { 
    background: url('images/yourimage.jpg') no-repeat center center fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

Naturally, you can do without external css and just included it directly in header

Community
  • 1
  • 1
Petter Friberg
  • 21,252
  • 9
  • 60
  • 109