Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Table cell Word Wrap
Table cell Word Wrap [message #630269] Fri, 01 October 2010 11:29 Go to next message
Sapphie Missing name is currently offline Sapphie Missing nameFriend
Messages: 21
Registered: October 2010
Junior Member
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 #630282 is a reply to message #630269] Fri, 01 October 2010 12:17 Go to previous messageGo to next message
Sapphie Missing name is currently offline Sapphie Missing nameFriend
Messages: 21
Registered: October 2010
Junior Member
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 #630328 is a reply to message #630269] Fri, 01 October 2010 15:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #630330 is a reply to message #630329] Fri, 01 October 2010 15:40 Go to previous messageGo to next message
Sapphie Missing name is currently offline Sapphie Missing nameFriend
Messages: 21
Registered: October 2010
Junior Member
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 #630363 is a reply to message #630330] Fri, 01 October 2010 18:19 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #676004 is a reply to message #630328] Thu, 02 June 2011 11:07 Go to previous messageGo to next message
pratim  is currently offline pratim Friend
Messages: 2
Registered: June 2011
Junior Member
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 !!
Re: Table cell Word Wrap [message #676051 is a reply to message #676004] Thu, 02 June 2011 14:54 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 !!
Re: Table cell Word Wrap [message #1291173 is a reply to message #630330] Thu, 10 April 2014 19:40 Go to previous message
Sachi Anand is currently offline Sachi AnandFriend
Messages: 2
Registered: October 2013
Junior Member
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.


Previous Topic:run vs frameset output problem
Next Topic:bar chart with 2 y-axes
Goto Forum:
  


Current Time: Fri Mar 29 09:13:45 GMT 2024

Powered by FUDForum. Page generated in 0.03685 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top