Table cell Word Wrap [message #630269] |
Fri, 01 October 2010 07:29  |
Eclipse User |
|
|
|
Hi All
I am new to BIRT and just trying to get to to grips with it. I am using the 2.6.1 all in one package.
I have created a report and added a table. The columns attached to the table are pulled from a MySQL database.
The problem I have is that if string data is added to table cells, I cannot get the text to wrap onto a new line. If I set the report layout as 'Auto Layout', the table expands to the right to accommodate the long line but this doesn't render properly in PDF.
If I use 'Fixed Layout' the string returned just gets truncated at the right hand edge of the cell. I want it to wrap onto a new line if necessary.
I thought BIRT was based on a web paradigm?
I must be doing something really stupid and missed something obvious. Can anyone point me in the right direction? i can't seem to see a 'word wrap' property anywhere.
Lee
|
|
|
|
Re: Table cell Word Wrap [message #630328 is a reply to message #630269] |
Fri, 01 October 2010 11:24   |
Eclipse User |
|
|
|
Lee
You may want to look at this thread.
http://www.birt-exchange.org/org/forum/index.php/topic/19827 -how-do-i-use-word-wrap-in-report-design/page__s__ad0bb32bbb ac95aee7b5556149417a73
If the element is a data element you could enter an expression like:
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("thisisatestofaverylongstringthatIdowanttowrap.", 6);
Just replace the wrap(str,size) with your data column
wrap( dataSetRow["mylongstring"], 6 );
If there is whitespace it should be autowrapping.
Jason
On 10/1/2010 7:29 AM, Sapphie wrote:
> Hi All
>
> I am new to BIRT and just trying to get to to grips with it. I am using
> the 2.6.1 all in one package.
>
> I have created a report and added a table. The columns attached to the
> table are pulled from a MySQL database.
>
> The problem I have is that if string data is added to table cells, I
> cannot get the text to wrap onto a new line. If I set the report layout
> as 'Auto Layout', the table expands to the right to accommodate the long
> line but this doesn't render properly in PDF.
>
> If I use 'Fixed Layout' the string returned just gets truncated at the
> right hand edge of the cell. I want it to wrap onto a new line if
> necessary.
>
> I thought BIRT was based on a web paradigm?
>
> I must be doing something really stupid and missed something obvious.
> Can anyone point me in the right direction? i can't seem to see a 'word
> wrap' property anywhere.
>
> Lee
|
|
|
|
|
|
|
|
Re: Table cell Word Wrap [message #1291173 is a reply to message #630330] |
Thu, 10 April 2014 15:40  |
Eclipse User |
|
|
|
Hi Jason,
I'm still having trouble on Text Wrap for a dataset row field, where I could see Table Whitespace = Normal, Row Whitespace = Normal : Inherited ; Cell Whitespace = Normal : Inherited and Data Whitespace = Normal : Inherited
See attached document on difference.
PS: Our BIRT version is 2.5.1
Appreciate your help on this regard.
|
|
|
Powered by
FUDForum. Page generated in 0.04396 seconds