How do i use word wrap in report design?
#1
Posted 09 June 2010 - 07:35 PM
I am using Birt report version 2.3.2.
I created a design in JDBC datasource and access the data.
and the dataset value is dateSetRow["CompnayName"]="sdssssssssssssssssssssssssssssssssssddddddfsfsfdsfdsfsdfsdfdsssssssssssssssssssss" like this.
I display the character is one line with out break the word when i view the report.
But i want to apply the Word wrap to that column.
Can I do this?
Please help me.
Myl
#2
Posted 11 June 2010 - 09:34 AM
You may have to use substrings or insert break characters into the string to get it to wrap to the next line. If I find anything else out on this, I'll post it in here.
#3
Posted 13 June 2010 - 07:08 PM
Now i found the solutions for word wrap. I call javascript method wrap(), that method i defined and now okay.
But the problem is starting here, when i view the report in Report viewer it display the output in HTML and PDF format. The same report i run through servlet means it display wrap() that is javascript method is not defined error.
Error : Unable to load Script file WebContent/scripts/WordWrap.js.
Error : A BIRT exception occurred: Error evaluating Javascript expression. Script engine error: ReferenceError: "wrap" is not defined. I attached my report design file and PrintResume XML file.
My Javascript code is : WordWrap.js
function wrap(longStr,width){
length = longStr.length;
if(length <= width)
return longStr;
return (longStr.substring(0, width) + "\n" + wrap(longStr.substring(width, length), width));
}
Can i add any jar files to my Project? or How can i solve this problem?
Attached File(s)
-
Resume1.rptdesign (154.77K)
Number of downloads: 83 -
PrintResume.xml (20K)
Number of downloads: 48
Myl
#4
Posted 02 June 2011 - 03:03 AM
Did you able to get rid of the exception, even i am seeing the exception when i try to do 'export data' to CSV format, from this report [which is deployed under tomcat server].
However i did not see any exception, if i do export data from BIRT eclipse setup.
Any help !!
#5
Posted 20 September 2011 - 09:47 AM
<div style="word-wrap: break-word"><VALUE-OF>row["longStr"]</VALUE-OF></div>
This works in both IE and Firefox, which supports the non-standard "word-wrap: break-word" style. Not sure about other browsers though.
#6
Posted 22 February 2013 - 02:23 AM
If it is table data then select that data and select the propertis ->General Tab -> whitespace set to Normal.
Just try it.
Mylsamy, on 09 June 2010 - 07:35 PM, said:
I am using Birt report version 2.3.2.
I created a design in JDBC datasource and access the data.
and the dataset value is dateSetRow["CompnayName"]="sdssssssssssssssssssssssssssssssssssddddddfsfsfdsfdsfsdfsdfdsssssssssssssssssssss" like this.
I display the character is one line with out break the word when i view the report.
But i want to apply the Word wrap to that column.
Can I do this?
Please help me.
#7
Posted 30 April 2013 - 02:01 AM
for word wrap in birt .. double click on data (data in table like email_Id).. on popup window ckick on
fx of expression column. Copy and paste following code
change EMAIL_ID to ur dataSetRow name
function wrap(longStr,width){
length = longStr.length;
if(length <= width)
return longStr;
return (longStr.substring(0, width) + "\n" +
wrap(longStr.substring(width, length), width));
}
wrap( dataSetRow["EMAIL_ID"], 15 );






MultiQuote







