innoventsolutions/birt-functions-lib

TextWrap does not split character blocks

Closed this issue · 4 comments

The TextWrap function is wrapping the text only if it has spaces in the word.

E.g. test test test test test

If my word has no spaces, the TextWrap function is simply truncating the data.

E.g. testtesttesttest

Is this the expected behavior of the function or a bug?


Original issue reported on code.google.com by e.scott....@gmail.com on 5 Aug 2010 at 1:23

Looks like we tokenize based on white space in the string, and then split those 
tokens if they over-run on size.  

How would you want it to behave if there are no spaces, a hard coded number of 
characters?  

The problem is that we wrote this for a client as a quick fix for a fairly 
specific set of conditions.  It works for that.  To have a true TextWrapping 
function you need to look at not just the number of characters but the size of 
those characters.  Calculating the size of the character block is possible but 
more work.  You also have to balance the need to split the string with the goal 
of keeping characters together.

We could work something up for you, but we would have to charge for it and we 
would need to understand what your specific goals and requirements are.  Let me 
know if you are interested and I can work up a quote.

Original comment by e.scott....@gmail.com on 5 Aug 2010 at 1:24

We can wrap based on pixel measurements but we will need a graphic context in 
order to do that.   A graphic context is available in a chart event handler or 
in a custom control such as the rotated text control.  In a javascript function 
I'm not sure if can get a graphic context.

Original comment by sschafer...@gtempaccount.com on 6 Aug 2010 at 8:16

I am not sure if the management will pay for the solution.
Can we control this using css?

Original comment by prashant...@gmail.com on 9 Aug 2010 at 6:02