carlogenohm Posted November 5, 2012 Share Posted November 5, 2012 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.jarjasperreports-fonts-4.7.1.jarhtmlcomponent.jar Can someone help on this?Thank you!Carlo Link to comment Share on other sites More sharing options...
marianol Posted November 5, 2012 Share Posted November 5, 2012 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? Link to comment Share on other sites More sharing options...
carlogenohm Posted November 5, 2012 Author Share Posted November 5, 2012 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> Link to comment Share on other sites More sharing options...
carlogenohm Posted November 5, 2012 Author Share Posted November 5, 2012 About Firebug. While developing, I am running the application in the eclipse environment. And the report is exported to a pdf. could I check the CSS or styles directly from Eclipse? Link to comment Share on other sites More sharing options...
marianol Posted November 5, 2012 Share Posted November 5, 2012 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. Link to comment Share on other sites More sharing options...
marianol Posted November 5, 2012 Share Posted November 5, 2012 Reposting my comment as an answer since the comment got scrambled: 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. Link to comment Share on other sites More sharing options...
marianol Posted November 5, 2012 Share Posted November 5, 2012 Ok That changes everything..... I assumed that you where exporting as HTML from your server app. If it's a PDF is should be exactly the same as the PDF that iReport Exported, are you using ireport 4.7.1? Link to comment Share on other sites More sharing options...
carlogenohm Posted November 6, 2012 Author Share Posted November 6, 2012 Hi, no, I was using iReport 4.5.1 Now I checked that: - if I use iReport 4.7.1, I obtain in the preview the "wrong version", as in the export to pdf java application - so I went back to iReport 4.5.1, where the preview is correct. - but if i use jasper libraries 4.5.1 (also htmlcomponent.jar compiled from the 4.5.1 package) again i get the wrong result. Summarizing: - 4.7,1 gives wrong result in both iReport and Java application - 4.5.1 gives good result in iReport, wrong result in Java application Link to comment Share on other sites More sharing options...
carlogenohm Posted January 7, 2013 Author Share Posted January 7, 2013 It does not work in iReport neither: submitted a bug, issue 2656 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now