If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Numbers are wrapped

Started by globalbear, 20 May 2013 05:42:13 AM

Previous topic - Next topic

globalbear

I noticed an annoying behaviour in Report studio with word wrap on numbers.

In a default (read: American) setup the character for thousand separator is comma and the decimal separator is dot. Now, since I'm Swedish I prefer the Swedish standard which is space as thousand seperator and comma as decimal separator. Ok - easy enough in report studio.

Now - what happens when a report is wide enough not to fit in one page? Well, all rows containing spaces are eligible for wrapping so that they appear on two different rows in the browser. Fair enough applied to a text string. But numbers? C'mon IBM - you can't wrap numbers in any meaningful way.

What happens is that a number such as 123 456 is wrapped and looks like
123
456
in the browser.

Now - the end user asks me: why are there two different numbers? 123 AND 456. I was politely trying to answer that the correct number is 123 thousand 456 and not 123 + 456.

I suppose a way of fixing this would be to set the white space property to No wrap but I see that most like a work-around not as a good solution.

The software in itself should be able to distinguish between text and numbers and know that you cannot wrap numbers.

Anyone else having the same experience and maybe a better solution then no wrap?

CognosPaul

The problem is that you're using the wrong space. There's a big big difference between " " and " " you know. " " is a no-break space, while " " is your standard run of the mill space space. Take the following string: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut quis urna nec diam auctor porttitor a eu tellus. Curabitur pharetra vulputate dolor sed condimentum. Sed porttitor lacinia magna, eu tincidunt sem ullamcorper nec. Quisque vehicula lacinia semper. Morbi vitae justo ultricies quam tempor pharetra ac vel lorem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla faucibus pharetra gravida. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mattis convallis iaculis. Praesent varius dictum tortor ut interdum. Integer diam justo, adipiscing ac bibendum id, pharetra ullamcorper felis. Curabitur sed ligula id est tristique commodo. Aliquam erat volutpat. Fusce elit augue, pellentesque ut feugiat quis, egestas nec lacus. Duis venenatis, nulla id blandit hendrerit, mi eros iaculis turpis, non fringilla elit lorem et sapien. Phasellus et bibendum sapien."

Notice how it wraps on spaces as you'd expect. But, let's try it with the other space! "Pellentesque auctor nisl sit amet velit eleifend vitae cursus ligula vulputate. Vivamus sed ipsum id orci condimentum auctor vitae et urna. Phasellus vulputate tristique velit, ac imperdiet eros dictum et. Vivamus ultricies nisl sed sem ornare gravida. Proin ut mattis velit. Mauris sed risus et nisi venenatis congue eget eleifend nulla. Donec semper tempor ipsum, in gravida lorem sodales non. Donec ac felis sem, dapibus pharetra est. Suspendisse libero velit, mattis ac bibendum eget, pharetra consequat sapien. Curabitur magna velit, vulputate eu pulvinar in, ornare feugiat leo. Aliquam lacus justo, dictum vitae pretium nec, tristique ut lorem. Nullam sollicitudin feugiat hendrerit. Vivamus adipiscing, metus eu consectetur varius, mi augue tempor elit, vulputate scelerisque justo eros et magna. Maecenas adipiscing, ante quis convallis ullamcorper, lectus sem euismod nulla, quis gravida nunc arcu et dui. "

The no break space is actually viewed as a letter, just like the comma. Type alt-0160 (using the number pad, not the top number row) to get it.

globalbear

 :D :D :D

Of course! Space is obviously not the same as space. Elementary my dear Watson. Or...

Technically it's obvious - ascii 32 is not the same as ascii 160 since ascii 160 does not line break.

But, how did the Cognos team think? If I select number as format type it's obvious I don't want the number to line break.
If you select thousand separator from the drop down menu in report studio you can use the option <space>. The space character actually used is ascii 32 that does line break. The default character for space should of course be ascii 160 when used inside a number. Didn't occur to me at all before I read your post.

So don't use the <space> option in the drop down menu, type alt-0160 instead and it works.

Thanks!

CognosPaul

Glad to hear it worked. I suspect that it's more of an oversight from the Cognos devs that just never got fixed. I suspect there's a way to fix it globally, probably some XML sheet that controls the data format, but I simply don't have time to go looking for it.