BIRT Exchange Forum: How do i use word wrap in report design? - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How do i use word wrap in report design? Rate Topic: -----

#1 User is offline   Mylsamy Icon

  • Junior Member
  • PipPipPip
  • Group: Members
  • Posts: 33
  • Joined: 29-March 10


Posted 09 June 2010 - 07:35 PM

Hi all,

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.
Thanks in Advance

Myl
0

#2 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12965
  • Joined: 16-May 08


Posted 11 June 2010 - 09:34 AM

Hi Myl,

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.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#3 User is offline   Mylsamy Icon

  • Junior Member
  • PipPipPip
  • Group: Members
  • Posts: 33
  • Joined: 29-March 10


Posted 13 June 2010 - 07:08 PM

Thanks for your valuable reply Williams,

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)


Thanks in Advance

Myl
0

#4 User is offline   pratim Icon

  • Junior Member
  • PipPipPip
  • Group: Members
  • Posts: 34
  • Joined: 31-March 10


Posted 02 June 2011 - 03:03 AM

Hi,
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 !!
0

#5 User is offline   garyxue Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 13
  • Joined: 24-September 07


Posted 20 September 2011 - 09:47 AM

Here is one solution. Put your content in a dynamic text item with the following text:

<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.
1

#6 User is offline   A.ASIKRAJA Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 24-January 13


Posted 22 February 2013 - 02:23 AM

Hi,
If it is table data then select that data and select the propertis ->General Tab -> whitespace set to Normal.
Just try it.



View PostMylsamy, on 09 June 2010 - 07:35 PM, said:

Hi all,

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.

0

#7 User is offline   deepakrkgi Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 03-January 13


Posted 30 April 2013 - 02:01 AM

hi myl

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 );
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users