How do i use word wrap in report design?

Mylsamy
Mylsamy Member
edited February 11, 2022 in Analytics #1
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.
Warning No formatter is installed for the format ipb

Comments

  • mwilliams
    mwilliams Member
    edited December 31, 1969 #2
    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.
    Warning No formatter is installed for the format ipb
  • Mylsamy
    Mylsamy Member
    edited June 14, 2010 #3
    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?
    Warning No formatter is installed for the format ipb
  • pratim
    pratim Member
    edited December 31, 1969 #4
    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 !!
  • garyxue
    garyxue Member
    edited December 31, 1969 #5
    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.
  • A.ASIKRAJA
    A.ASIKRAJA Member
    edited December 31, 1969 #6
    Hi,<br />
    If it is table data then select that data and select the propertis ->General Tab -> whitespace set to Normal.<br />
    Just try it.<br />
    <br />
    <br />
    <br />
    <blockquote class='ipsBlockquote' data-author="'Mylsamy'" data-cid="65425" data-time="1276140939" data-date="09 June 2010 - 08:35 PM"><p>
    Hi all, <br />
    <br />
    I am using Birt report version 2.3.2.<br />
    <br />
    I created a design in JDBC datasource and access the data.<br />
    <br />
    and the dataset value is dateSetRow["CompnayName"]="sdssssssssssssssssssssssssssssssssssddddddfsfsfdsfdsfsdfsdfdsssssssssssssssssssss" like this.<br />
    <br />
    I display the character is one line with out break the word when i view the report.<br />
    <br />
    But i want to apply the Word wrap to that column.<br />
    <br />
    Can I do this?<br />
    <br />
    Please help me.<br /></p></blockquote>
  • deepakrkgi
    deepakrkgi Member
    edited December 31, 1969 #7
    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 );
  • Carver
    Carver Member
    edited September 25, 2016 #8
    <blockquote class="ipsBlockquote" data-author="deepakrkgi" data-cid="116378" data-time="1367316104">
    <div>
    <p>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 the vigrx site <a data-ipb='nomediaparse' href='https://dudehung.com/vigrx-plus-review-results-2016'>https://dudehung.com/vigrx-plus-review-results-2016</a&gt; and get a freebie with the 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 );</p>
    </div>
    </blockquote>
    <p> </p>
    <p>Where exactly to I paste this code deepak?</p>
  • 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 http://aboutmens.com/ eclipse setup