Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Html formatting in doc version
YogeshJ
Hi am working on birt 2.2.1 and in one report using dynamic text element i am displaying the text information.
but the this text may contain some html tags like following string
"The <B>bold</B> and <i>italic</i> text should be dispay correctly in<u> doc</u>".
except "doc" version all are fine but in "doc" it removes space ,before and after the word.
so it display like following
"Theboldanditalictext should be dispay correctly indoc"
How can i fix this problem ? any work around ?
Thanks
Yogesh Jarad
Find more posts tagged with
Comments
kclark
Yogesh, I'm not sure if this will work for you with the report you're building but you could try.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
'The ' + '<b>bold</b>' + ' text'
</pre>
<br />
I also tried your code in 3.7.2 without any problems, if you can you could also upgrade your BIRT to this,
YogeshJ
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="112746" data-time="1356534295" data-date="26 December 2012 - 08:04 AM"><p>
Yogesh, I'm not sure if this will work for you with the report you're building but you could try.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
'The ' + '<b>bold</b>' + ' text'
</pre>
<br />
I also tried your code in 3.7.2 without any problems, if you can you could also upgrade your BIRT to this,<br /></p></blockquote>
<br />
Thanks for you immediate reply!. The text which i am displaying it retrieve from database and i can't update <br />
the birt vestion too.
kclark
It might not be the best solution but you might be able to create a computed column and use replace() to add non-breaking space's to the string.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var firstString = row["someData"];
this.value = firstString;
this.value.replace("<b>"," <b>");
</pre>
<br />
You would need to do that for all html tags opening and closing, so depending on how much HTML you have in the DB this may or may not be a solution.
YogeshJ
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="112758" data-time="1356552470" data-date="26 December 2012 - 01:07 PM"><p>
It might not be the best solution but you might be able to create a computed column and use replace() to add non-breaking space's to the string.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var firstString = row["someData"];
this.value = firstString;
this.value.replace("<b>"," <b>");
</pre>
<br />
You would need to do that for all html tags opening and closing, so depending on how much HTML you have in the DB this may or may not be a solution.<br /></p></blockquote>
<blockquote class='ipsBlockquote' ><p>
Thanks Sir,<br />
Yes we can do this way and it is working!<br />
But can we improve this by replacing tags only when we are displaying in doc version and not for other ? <br />
Can i get handle of the emitter type in script ?<br /></p></blockquote>