Skip to main content



      Home
Home » Archived » BIRT » Format problem in PDF (text doesn't wrap)
Format problem in PDF (text doesn't wrap) [message #89267] Wed, 09 November 2005 10:52 Go to next message
Eclipse UserFriend
Originally posted by: maria.kouras.gmail.com

I'm trying to display the content of a database text field containing a
long chunk of text. In preview and HTML modes the report looks great -
the text wraps according to the width of the text field. However, in PDF
the text spills over the page and doesn't wrap no matter how I adjust the
width of the field. I've tried using data and text report items and can't
seem to get it to work. Any help is much appreciated. Thanks!
Maria K.
Re: Format problem in PDF (text doesn't wrap) [message #89372 is a reply to message #89267] Wed, 09 November 2005 15:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

I'm experiencing the same problem.
Re: Format problem in PDF (text doesn't wrap) [message #89554 is a reply to message #89267] Thu, 10 November 2005 03:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi Maria,

I have the same problem but I found a solution that works for me.

As in my case this problem occures only with strings like this
VERY_LONG_TEXT_WHERE_ALL_IS_IN_UPPER_CASE_WITHOUT_BLANKS I use the following
peace of code to add the unicode character 'ZERO WIDTH SPACE' (U+200B) to
the output expression to allow FOP to break at that position.

The original output expression was row["EXTERNALID"] in my case, of course
you have to modifiy the code to output your database field.

if (row["EXTERNALID"].length > 25) {
length = row["EXTERNALID"].length;
row["EXTERNALID"].substr(0, 25) + "\u200B" +
row["EXTERNALID"].substring(25, length);
} else {
row["EXTERNALID"];
}

Be aware that this only works for PDF output as in the HTML output you may
see the "zero width space", but I think that depends on the encoding.

It would be great if the BIRT team could take some time to investigate on
that and provide a way to force a linebreak.

I hope this helps

Klaus


"Maria K" <maria.kouras@gmail.com> schrieb im Newsbeitrag
news:b89bc10e9d71e0654c7b9f9b42f6dd5e$1@www.eclipse.org...
> I'm trying to display the content of a database text field containing a
> long chunk of text. In preview and HTML modes the report looks great -
> the text wraps according to the width of the text field. However, in PDF
> the text spills over the page and doesn't wrap no matter how I adjust the
> width of the field. I've tried using data and text report items and can't
> seem to get it to work. Any help is much appreciated. Thanks!
> Maria K.
>
Re: Format problem in PDF (text doesn't wrap) [message #89657 is a reply to message #89267] Thu, 10 November 2005 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Does anyone know if the 2.0 release has fixed this?
Re: Format problem in PDF (text doesn't wrap) [message #89933 is a reply to message #89657] Thu, 10 November 2005 16:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.none.none

At some point, in this newsgroup, one of the BIRT team said that FOP (the
PDF engine) was being replaced by a homegrown version for 2.0. However, I
have not heard anything about it since then and I didn't notice it in the
2.0 project roadmap.

"Mark Lorenz" <mlorenz@nc.rr.com> wrote in message
news:3c3be8f88e71999584be3341c91e8d15$1@www.eclipse.org...
> Does anyone know if the 2.0 release has fixed this?
>
Re: Format problem in PDF (text doesn't wrap) [message #89948 is a reply to message #89267] Thu, 10 November 2005 17:43 Go to previous messageGo to next message
Eclipse UserFriend
María,

I'm working with Eclipse 3.1.1 and Birt 2.0M2 on Java 5

I'm sorry to tell you that the problem persists (It is'nt fixed). BIRT's
PDF viewer only wraps words. So, if you have a really long word, you have
a problem. If your 'big chunk of text' is all in a word (looks odd to me)
you are in a problem. If it's composed of normal words it should wrap. If
it does'nt, perhaps you have a non standard word separator (e.g a space).

Good luck
Re: Format problem in PDF (text doesn't wrap) [message #91249 is a reply to message #89554] Tue, 15 November 2005 16:33 Go to previous message
Eclipse UserFriend
Does BIRT support the capability to wrap this code into a stand-alone
function?


Klaus Kierer wrote:
> Hi Maria,
>
> I have the same problem but I found a solution that works for me.
>
> As in my case this problem occures only with strings like this
> VERY_LONG_TEXT_WHERE_ALL_IS_IN_UPPER_CASE_WITHOUT_BLANKS I use the following
> peace of code to add the unicode character 'ZERO WIDTH SPACE' (U+200B) to
> the output expression to allow FOP to break at that position.
>
> The original output expression was row["EXTERNALID"] in my case, of course
> you have to modifiy the code to output your database field.
>
> if (row["EXTERNALID"].length > 25) {
> length = row["EXTERNALID"].length;
> row["EXTERNALID"].substr(0, 25) + "\u200B" +
> row["EXTERNALID"].substring(25, length);
> } else {
> row["EXTERNALID"];
> }
>
> Be aware that this only works for PDF output as in the HTML output you may
> see the "zero width space", but I think that depends on the encoding.
>
> It would be great if the BIRT team could take some time to investigate on
> that and provide a way to force a linebreak.
>
> I hope this helps
>
> Klaus
>
>
> "Maria K" <maria.kouras@gmail.com> schrieb im Newsbeitrag
> news:b89bc10e9d71e0654c7b9f9b42f6dd5e$1@www.eclipse.org...
>
>>I'm trying to display the content of a database text field containing a
>>long chunk of text. In preview and HTML modes the report looks great -
>>the text wraps according to the width of the text field. However, in PDF
>>the text spills over the page and doesn't wrap no matter how I adjust the
>>width of the field. I've tried using data and text report items and can't
>>seem to get it to work. Any help is much appreciated. Thanks!
>>Maria K.
>>
>
>
>
Previous Topic:BIRT vs Oracle Reports
Next Topic:Charts icon in Report Designer no Appearing
Goto Forum:
  


Current Time: Mon Jul 14 04:33:42 EDT 2025

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

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

Back to the top