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

Changing Column width in list

Started by yossiea, 13 Feb 2017 08:22:01 AM

Previous topic - Next topic

yossiea

Hi,
I hope there is something stupid I am overlooking. I have a list report where one of the columns needs to be a fixed width. I did set the column to a pixel/point/inch, etc. but nothing I do works. Any help would be appreciated.

-edit- Right now the report is one page, I am OK with scrolling to the right, but I can't get that to scroll.

Deep750

If the content within the column is wider than you have set, it won't work.
What you can do, is to put the list in a block, and set a fixed width on that, with selecting the option to use "scrollbars", in the size and overflow-option

yossiea

#2
Thanks. I set the column width (for testing) to a really large pixel size but it still didn't work.
I don't want to set the block to a specific size because other columns in the list need to fluctuate, it's just this one column that the client wants to have a fixed size. As it is now, the column displays just a few words on a row and then it goes down many columns.
If I set the block to a wide enough size, the other columns are far too wide and there is way too much scrolling.

Invisi

Is your table still set on 100% width? This annoying Cognos 'feature' may cause you some issues. Consider it's still HTML and CSS. What I remember with tables is that when you set a width somewhere, all widths of other table elements are related. So having the table be at 100% may cause your table to still get your 1 column relevant to the content width of other tables... I think! Not sure!
Few can be done on Cognos | RTFM for those who ask basic questions...

yossiea

Yeah, sometimes Cognos can be a real chore. I have nothing set as the width on the list or the block it's in. I think I may end up just giving up and seeing if having a report is more important than having a report with a fixed width.

Invisi

I just try it on a simple check report I make, and the colums gets very wide... You put something in Size & Overflow?
Few can be done on Cognos | RTFM for those who ask basic questions...

yossiea

Nothing. If I set it to a size on the list, then the columns get super wide, but I just want to change one column. It's really frustrating how simple the request is, yet Cognos makes things so difficult. Keep in mind this report has variables and if/then in the query and Cognos handles it fine, it's a stupid column width that is getting me.

hespora

Just asking out of the blue here: Are you *certain* you're setting the width on the List Column, and not on the List Column Body or the List Column Title? Just by clicking, you can only select either of the two; you'd have to go through the properties' ancestor button to select the List Column proper.

yossiea

Thanks for the suggestion. I have tried all three actually to see if one works but none of those work. I set different sizes as well, but it just seems to not want to change size.

yossiea

The workaround I got was to change the column header to text and then put in a string of spaces followed by the column label and then a string of spaces. That got the column wide enough.

Invisi

As I said, it must be something you did with that list. I do it here on my client's Cognos 10.1 with the Size & Overflow on the 1 column and the width adjusts beautifully. On a logical place and simple to alter.

Does it happen with HTML output? Or PDF?
Few can be done on Cognos | RTFM for those who ask basic questions...

psrpsrpsr

I'm a beginner Cognos developer as well and I just wanted to chime in and say that this is really simple stuff that should not be so complicated. I'm using 10.2.2 and the number of productivity hours I've lost doing monkey work on output formatting is astounding.

CognosPaul

The thing to remember here is that Cognos is outputting HTML and CSS2. If a table exceeds the width of a page, it WILL try to squeeze down the size of the cells. If we had access to modify the styles directly, we could add 'min-width' to the cells. This isn't a Cognos thing, it's a HTML thing.

For some reason, Cognos doesn't give us all of the possible styles; I suspect it is because the PDF writer doesn't support all CSS2 styles, but that is really just a guess.

In your case, we can cheat. Create a class called minWidth500, give it width:500. If you're using a real browser you need to copy the entire report to clipboard, but IE will allow you to copy objects directly into the clipboard. Either way, get the XML into notepad and modify it from:
<classStyle name="minWidth500"><CSS value="width:500px"/></classStyle>

to:
<classStyle name="minWidth500"><CSS value="width:500px;min-width:500px"/></classStyle>

Adding the min-width will ensure it doesn't get squeezed down. You can add max-width as well if you need.

Attached is an example.