hyphen at the end of line

Hi,

I have a requirement to put a hyphen ("-") at the end of line. for eg if a word in cell comes to a second line after word wrap then it should have hyphen at the end like

–> “webintelligence”
–> “webintell-
igence”

Kindly let me know how to achieve this in webi?

Regards,
Balaji


balaji_chimmani (BOB member since 2007-11-22)

That’s a tricky one!

Are you able to work out how many characters you can fit on a line in the wrapped cell including the “-” or is changing?

I would expect that Capitals will complicate this but, if you’re working with a variable that has limited number of total characters you could try breaking it up into sections & inserting “-” between sections.

For instance (and I’ve not got the time to do this in formula at the mo)

  • say you’ve got 7 characters possible on a line.
  • if the 7th and 8th characters of the variable string are characters (use isstring() to find out), then left([string];6)+"-"+substr([string];7;7)

That’s quite a closed statement and would cope if the string of text you’ve got is only ever less than or equal to 14 chars long…

If your string is longer than that, then you would have to nest various tests on your string to determine if and when a “-” is necessary.

To be honest, I do kind of doubt this would work as you might hope because (potentially) of either Capital Letters or letters like “i” which are thinner than “e” - for example. There’s no way I can think of to just automatically format a cell to pop a hyphon at the end of a row in a cell… which is a shame because that’d be the prefered solution.

You may have to turn round and say it’s not possible if noone else can help.


SteveD :uk: (BOB member since 2009-11-02)

An alternative is to shove a column to the right of the column in question and populate it with a single hyphen left justified. Hide the borders beween the columns and off you go. You’d need to right justify the first column which may look strange, so not ideal but saves coming up with a really nasty formula.


Nick Daniels :uk: (BOB member since 2002-08-15)

Word wrap should wrap on whole words, it will not split in the middle of a word. Do you really need a hyphen in that case?


Dave Rathbun :us: (BOB member since 2002-06-06)

They obviously have a mega fussy manager! Nick, I like your solution, but at the end of the day you’d still have to tackle the subject of when and where you’d need a hyphen in the string of text. To be honest I’d tell someone requesting this that it’s just not possible and move on to something that really matters!


SteveD :uk: (BOB member since 2009-11-02)

Yes, that is the opinion I am veering towards - I think we need to hear back from the original poster.


Nick Daniels :uk: (BOB member since 2002-08-15)

The exception will be when you have something that is simply too long (eg ThisIsMyColumnNameThatHasNoSpacesToWrapOn). That will wrap in a weird spot.

Chances are this problem could be solved for most cases by increasing the column width - and then as Dave says the word wrap feature will not split too many words.


weaver (BOB member since 2008-10-17)

According to HTML specs, a long word should not wrap at all. That’s why this

12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

… will break the layout of this post. :slight_smile:


Dave Rathbun :us: (BOB member since 2002-06-06)

:lol: nice way to make a point!


SteveD :uk: (BOB member since 2009-11-02)

Thanks for the reply

–> My values in the column are of variable lengths so i can not put statis lengths in substrings.

–> Report’s format is so tightly coupled such that if you add a single column the table goes to the second page, i have to fit whole thing into a single page.

Regards,
Balaji


balaji_chimmani (BOB member since 2007-11-22)

I was wondering why all the replies to this thread were scrolling of the page and I’ve got a 24inch widescreen monitor at work !

Once I got to this pos, it all made sense.


Nniixx :australia: (BOB member since 2009-09-02)