Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos 8: Crosstab headers out of line when hiding columns

Status
Not open for further replies.

rmatthew

Programmer
Apr 29, 2005
5
GB
Hi,

I have a crosstab that looks like the following (because of the proportinal font user here I have used X's, the first 2 lines are the header (top one is a date and the 2nd one is cost/sales/margin) and the second 2 are the data):



|_______XXX__________|_______XXX_________|
|XXXXX|XXXXX|XXXXXX|XXXXX|XXXXX|XXXXXX|
|XXXXX|XXXXX|XXXXXX|XXXXX|XXXXX|XXXXXX|
|XXXXX|XXXXX|XXXXXX|XXXXX|XXXXX|XXXXXX|


I have a parameter that allows the user to specify whether they want to shot the margin column or not. I am using conditional styling to set the box type of the margin cells to None if they say no. This is working fine except that the date headers become offset, so the table looks like the following:

|_______XXX__________|_XXX_|
|XXXXX|XXXXX|XXXXXX|XXXXX|
|XXXXX|XXXXX|XXXXXX|XXXXX|
|XXXXX|XXXXX|XXXXXX|XXXXX|

So the date headers are still spanning 3 columns even though only 2 data columns per period.

Has anyone seen this before and know a fix?

Thanks in advance for your help.

Railton.
 
Use a render variable on the list column. This will show/hide the complete column including the header and this will sort the out-of-line issue

Ties Blom

 
Hi,

Thanks for the response. Unfortunately I don't have render variables on crosstab columns. It works for a list but not a crosstab.

Railton.
 
sorry, I was a bit too quick..

Setting box types to none is a bit of a hassle. It is much easier to have 2 type of crosstabs , each of them in a block and render the block according to some logic..

Ties Blom

 
Ah I see what you mean. The problem I have is that I have multiple columns that I want to show/hide I would have to create a crosstab for each possible combination!!

I have found a workaround but it is not very slick. To hide the column I set the padding and width to 0, put the column heading text in a table and set the box type of that to none. I also have to update the query to ensure that the values are null for that column that needs to be hidden. This then collapses the column down so that it is invisible.

Railton.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top