erctheanda Posted August 25, 2010 Share Posted August 25, 2010 Hi all,Currently there is a requirement to embed custom HTML code into a JASPER report and then to export it as a PDF with the HTML rendered.The HTML is well formed and does not use all the tags.To fufil this requirement, the JRXML i am using has this particular piece of code.The HTML i am using is also attached.The tags that don't get rendered are the following1. Table related2. italic3. bold4.indentation5. Justify, alignCode: <detail> <band height="239" splitType="Stretch"> <textField isStretchWithOverflow="true" evaluationTime="Auto" pattern="" isBlankWhenNull="true"> <reportElement key="element-1" mode="Opaque" x="0" y="0" width="487" height="239" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF"/> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single" markup="html"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["<html>" +"<body>" +(($F{htmlContent} != null) ? String.valueOf($F{htmlContent}) : "") +"</body>" +"</html>"]]></textFieldExpression> </textField> </band> </detail> Link to comment Share on other sites More sharing options...
erctheanda Posted August 30, 2010 Author Share Posted August 30, 2010 Anyone? Link to comment Share on other sites More sharing options...
erctheanda Posted September 8, 2010 Author Share Posted September 8, 2010 BUMP for awareness.If anyone can help? Link to comment Share on other sites More sharing options...
birnbuazn Posted February 21, 2011 Share Posted February 21, 2011 Got the same problem.Unfortunately, the issue at http://jasperforge.org/projects/jasperreports/tracker/bug_view_page.php?bug_id=4842 was left unanswered as well. So no luck there.I'm currently leaning towards implementing an XSLT stylesheet which transforms my HTML into Jasper's own styled text markup tags. Does anyone have experience in this?IMHO, there should be a simpler way to render justified/indented HTML text fields in a PDF. Sigh. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted February 21, 2011 Share Posted February 21, 2011 Hi, In a future version, we'll probably try to do something else about indenting and alignment. I have replied to that tracker you mentioned, but also pointed to this other tracker which is probably more in line with what people expect:http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4256 Unfortunately for us, the JR team, we are not going to see an end to this story because only the sky is the limit in terms of what HTML tags folks think we should support. Think of only the fact that people want CSS styling to work, so we would keep adding to this feature for years from now. Thanks,Teodor 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