I’m using ADF rich text editor that saves formatted HTML in
a database field (CLOB). Then using BI Publisher for generate a report with RTF
template that includes that formatted text. The result gives me a bad formatting for line
breaks (<br/> tags) and paragraph (<p> tags) for PDF report format.
My field data is as follows: <p>...<br/>...<br/>...</p>
A solution that works for me is the following:
·
- set the data type for field on report model as
XML
·
- on the SQL use this for your RTE field
'<![CDATA' || '['|| replace(replace(RTE_FIELD_NAME,'<br/>', '<fo:block linefeed-treatment="preserve"></fo:block>'),'<p>','<xsl:text>
'<![CDATA' || '['|| replace(replace(RTE_FIELD_NAME,'<br/>', '<fo:block linefeed-treatment="preserve"></fo:block>'),'<p>','<xsl:text>
</xsl:text>') || ']' || ']>'
·
- On RTF template use this on the field on the
advanced tab:
<?html2fo:RTE_FIELD_NAME?>
If you have multiple <p> tags you can replace them first with double <br/> 's and replace after the <br/> with:
<fo:block
linefeed-treatment="preserve">
</fo:block>
Thanks Christos. This post really helped us out today.
ReplyDeleteits not working for me : Namespaceprefix 'html2fo' used but not declared
ReplyDeletediv tag is not displaying properly. Can you please tell me how to handle this situation?
ReplyDelete