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!

Dynamically hide columns

Status
Not open for further replies.

timida

MIS
Feb 1, 2004
43
0
0
AT
Hello!

I created a report (Impromptu 7.0) where the user should determine if he want's to see a certain column (e.g. target values) or not.

I already looked through the thread401-331757 , but the solution of this threat only is for displaying either one or another column.

I only want to display column A when the user answers the prompt with "Y" otherwise (answer is "N") I don't want to see the whole column! With conditional formats I'm only able to hide the values but not the whole column.

Is there a way to do this?
 
As far as I'm aware Impromptu doesn't allow conditional suppression of a whole column.

Even when the Hidden Style is used with conditional formatting the column header is still displayed.



Gary Parker
MIS Data Analyst
Manchester, England
 
timida,

There are a couple of issues here. When you applied the conditional format, did you select the entire column by moving the cursor to get a white down arrow before selecting, or did you just select a single cell? If you selected the cell alone, it probably did not include the column header in the selection, so that still appears over a blank column. Try it by selecting with the down arrow and see if that does the trick. If this doesn't fix it, let me know and I'll lay out other options.

Regards,

Dave Griffin




The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
hello,

I selected the entire column by moving the cursor to get the white down arrow. Then I applied the conditional Format (?SHOW? = 'N' --> Style = Hidden). Afterwards the values of the column are hidden, however, the heading of the column is still displayed.
In addition I tried to select the column title and apply the same conditional format. But impromptu does not save the conditional format, it always shows (?SHOW? = 'N' --> Style = None).

kind regards,
timida
 
Timida

When I follow the steps you listed above to set the conditional formatting on the column header, the formatting is saved ok.

However the data is hidden but the column title is only greyed.



Gary Parker
MIS Data Analyst
Manchester, England
 
Timida/Gary,

I have tried this under version 6 and 7.1, wtih results consistent with what Gary has found.

What you wind up having to do is to follow the steps indicated in thread401-331757, including creating dynamically named column headers. Even with doing this steps, the "hidden" column doesn't really go away. This means that unless you want ugly white space in the middle of your report, make that column the last one on the right side of the report. Sorry I can't offer a more elegant solution. The Cognos Knowledgebase doesn't even mention this issue as a problem, much less offer a work-around.

Regards,

Dave Griffin

The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
OK, this still doesn't "remove" the column and column header but I found a solution for Gary's "grayed" out column header issue.

Use the conditional format as you were for the column itself. Then for the column header, go into conditional formats, click on STYLES, pick one at random such as LIGHT EMBOSS, and click EDIT. Turn on FONT it not already checked and change the font color to white and go to the PATTERNS tab and make sure the top item is TRANSPARENT.

Set that modified style as the conditional format for the column header and it'll become invisible when printed on white paper.

Again, I know not exactly what you're looking for but at least you can make the column data and also the header invisible now if that's sufficient.

Scott

 
... or instead of modifying an existing style, just create a new one.
 
iguanadon (Scott),

I think what they are trying to do is to make the hidden column completely disappear. Your solution would make the title vanish, but the extra white space the column represents would remain.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Hello all,

thanks for your various answers. I found out that it is not possible to set a conditional format on a column header of a column from a crosstab-report (the column is inserted under rows). At least this doesn't work for me, and I tried it with Impromptu 7.0 and 7.1.
However, only hiding the text of the column doesn't help me. As griffindm guessed, I want to hide the whole column.

COLUMN A | COLUMN B | COLUMN C | (several crosstab columns)

When the user answers the prompt with 'N' the report should only display (without white space or an empty column):

COLUMN A | COLUMN C | (several crosstab columns)

... well as there is also no solution for this "problem" in the Knowledge Base of Cognos, I guess it is not possible to dynamically hide columns...

Regards
Timida
 
Hi,

There is one solution...

You can display the columns you want hide in a separate list frame as a subquery. Then you can hide whole frame with conditional format. Little strange but should work.

Regards,





 
Timida,

I've actually done what you are trying to do, but I hesitated to outline the method, as it is a little complex.

What I do is to create calculated display columns for all of the detail (or apparent detail) data the report will display. I also create calculated text display headers for these as well. Like display01,display02,display03 and disp_lbl01,disp_lbl02, etc . Then, based on user prompt input, determine which of your query columns will be shown as the display column, in the data definition of these diplay columns, as in:

display01 = if(?prmpt? = "C") then (Customer) else if(?prmpt? = "V") then (Vendor) else ("") ...

The key here is that you always left-shift the data so that any display column that is unused is always on the right edge of the report. Similar logic is in the display header label so that it is left empty when not used.

Complicated, but effective. The only real difficult issue to deal with is where the data in the displayed columns require different formatting, which can be done with custom styles.

Hope this helps,

Dave Griffin








The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Thanks again for your help griffindm and seweryng.
However both of your solutions are to "complex" for my report. The hiding of the column was only a nice-to-have and so those solutions are too complex and too much work for my quick and basic report. So I decided to always display the column ;)

kind regards
timida
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top