s.ferraz Posted December 9, 2019 Share Posted December 9, 2019 Good morning,I have a rich text editor in my system that writes the data as HTML in the database.However, when I read this data on jaspersoft and insert it in the text field with markup html, it's really unformatted.In this site forum, I read that jasper only accepts a few html tags.Considering it, How can I convert this data to accept it in Jasper without losing formatting? Link to comment Share on other sites More sharing options...
C-Box Posted December 11, 2019 Share Posted December 11, 2019 As far as I know Jasper still doesn't support full html source/tags within textfields. Just the simple ones like for example <b> <i> <u> <font> <sup> are supported. It's quite difficult to implement a (inner) content changing layout within a simple textfield that is part of a JasperReport (outer) design as well. So imagine a <table> within a textfield that is part of a table component in Jasper also?!? So I guess that's why there won't be any FULL html support in JasperReports.There was a HTML Component (look into the tracker for former discussions with Teodor) that actually should do that, but this isn't working as expected.So the only way I know is to render the content with e.g. the JEditorPane or any other "html2image" component to an image object and print that in your reports.... but then you have to live with the limitations of scaling, resolution and breaking pages. So a very ugly solution.Sorry but perhaps anyone knows it better!??!regardsC-Box Link to comment Share on other sites More sharing options...
djohnson53 Posted December 11, 2019 Share Posted December 11, 2019 The reason that only a limited number of HTML tags are supported is largely for security. 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