Hello.
I want to generate a report with an html component.
If I compile it in iReport, the html component looks nice
(Description is a static text field; the html component is what you see in the right hand side):
BUT, if i compile from my server application, the html component appears all shrinked in the top left corner of the field:
The server application refers to the libraries:
jasperreports-4.7.1.jar
jasperreports-fonts-4.7.1.jar
htmlcomponent.jar
Can someone help on this?
Thank you!
Carlo
3 Answers:
Check the output with Firebug. I think that it may be related on the CSS and Styles that are in the server.
Can you share the HTML that you are using insife the HTML component?
Thanks for the fast answer!
This is the html component:
<p>
<strong>Rich text</strong></p>
<p>
Description<br />
<br />
<strong>Bold text</strong><br />
<br />
<u>Underlined text</u><br />
<br />
Super<sup>script</sup></p>
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td>
first column</td>
<td>
second col</td>
</tr>
<tr>
<td>
</td>
<td>
second row</td>
</tr>
<tr>
<td>
third row</td>
<td>
</td>
</tr>
</tbody>
</table>
<p>
</p>
Jasper Server Overrides a lot of the standard HTML tags (like p , table, etc) via CSS to use their own fonts, widths, etc.
Check with Firebug on your browser and you will see the current styles that get applied to your table.
Just a quick looks at the CSS on Jasperserver you can see that the main font type and size has been overridden in theme.css:
body, textarea, .body, .title > .path, input, select {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:normal;
line-height:1.182em;
}
To get the output you want you will need to use your own CSS styles in the HTML.
Reposting my comment as an answer since the comment got scrambled: