Home
Analytics
Wrapping text on html table
kdureidy
I have a problem with long name string without spaces when I view the report on HTML format, the table column expanded depending the string length and ignore the column width
VeryVeryVeryVeryVeryVeryLongString |
it should be
VeryVeryVeryVeryVery |
VeryLongString |
I tried to add this css
<style id="s" type="text/css">
table {
table-layout: fixed;
width: 100%;
overflow: hidden;
word-wrap: break-word;
}
</style>
but birt does not read see the style tag in the report
is there any other solution to do the wrapping? or any suggestion to add this style tag?
Thanks,
Khalil Dureidy
Find more posts tagged with
Comments
JasonW
Have you seen this thread?<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/forum/designing-birt-reports/13587-not-able-wrap-dynamic-text-cell.html'>http://www.birt-exchange.org/forum/designing-birt-reports/13587-not-able-wrap-dynamic-text-cell.html</a><br
/>
You can also inline the word-break using a text element like:<br />
<br />
<div STYLE="word-wrap: break-word">thisisatestofaverylongstringthatIdonotwanttowrap.</div>
If the string is from a row value it would look like:<br />
<div STYLE="word-wrap: break-word"><value-of>row["MyDbCol"]</value-of></div>
<br />
Jason
kdureidy
I saw the thread : "Not able to wrap dynamic text in a cell"
actually me and my team wrote that solution, but i don't recommend it because its a performance hit, and i don't want to fix the cosmetics to lose the performance.
when i tried your solution, it doesn't work, and when i view the source of the exported HTML, the CSS code (style = "word-wrap: break-word") does not appear in the html source. seems like birt ignore any CSS lines inside the report design.
is there any other way to force birt to read the style?
Thanks,
Khalil.
JasonW
Khalil,
When you say the exported html does not inlcude it, how are you looking at the html? If you want to see the html generated use the /preview mapping instead ot the /frameset mapping. The /frameset mapping using ajax to load the report at runtime so you will not see it in the output.
Look at the attached report.
Jason
kdureidy
Hi Jason
Thanks a lot, it works now
<div STYLE="word-wrap:break-word; width: 50px"><VALUE-OF>row["data"]</VALUE-OF></div>
Thanks,
Khalil.