|
|
Re: Table cell Word Wrap [message #630328 is a reply to message #630269] |
Fri, 01 October 2010 15:24 |
|
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 #630329 is a reply to message #630282] |
Fri, 01 October 2010 15:26 |
|
Sorry I did not see your reply. The default style for a table cell
should be normal. Was this a new report?
Jason
On 10/1/2010 8:17 AM, Sapphie wrote:
> Well, no sooner have I posted the query, I now find the answer! A table
> cell or column can have a Text.Whitespace property. Mine was set to 'No
> wrapping', whereas if I set it to 'Normal' I get the result I want,
> including whet creating a PDF.
>
> So, I guess I wonder why this property is not set to 'Normal' by default
> and how can I make it the default for all future tables?
>
> Thanks
>
> Lee
|
|
|
|
Re: Table cell Word Wrap [message #630363 is a reply to message #630330] |
Fri, 01 October 2010 18:19 |
|
Lee,
Thanks for the thoughts. Fixed is generally the best approach when PDF
output is needed.
Jason
On 10/1/2010 11:40 AM, Sapphie wrote:
> Thanks Jason.
>
> It was for a new report but I had tinkered with it, changing column
> widths, changing from auto-format to fixed format and back again.
> Somewhere along the way this property got set to No Wrap.
>
> Of course, it's entirely possible that I had set it that way myself but
> I don't remember doing so!!
>
> I am also looking at how best to lay these reports out, when I want the
> option to be viewed on the web and to generate a nicely formatted PDF.
> Seems like 'Fixed layout' is the best choice in this scenario.
>
> So far I am quite impressed with it though. We also use Oracle
> Discoverer ...
>
> Lee
|
|
|
|
Re: Table cell Word Wrap [message #676051 is a reply to message #676004] |
Thu, 02 June 2011 14:54 |
|
Where do you have the wordwrap function defined and where are you
calling it?
Jason
On 6/2/2011 7:07 AM, pratim wrote:
> Hi Jason,
> I checked the linked provided by you, where i am seeing the exception
> mentioned over there. When i try to do 'export data' to CSV format, from
> this report [which is deployed under tomcat server], i am getting
> exception saying function wrap() is not defined.
>
> However i did not see any exception, if i do export data from BIRT
> eclipse setup.
>
> Any help !!
|
|
|
|
Powered by
FUDForum. Page generated in 0.06522 seconds