COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bonniehsueh on 14 Jun 2008 11:21:29 AM

Title: Use Page Number to conditionally display an object
Post by: bonniehsueh on 14 Jun 2008 11:21:29 AM
When Page Number = 1 then I want to hide a table. I created a variable with expression Page Number () = 1. Used a Style variable to set box type = none. However when I run the report the table doesnt show at all.
I also placed the Page Number() function on the report page and the page number did show.

I also wanted to check if i was going crazy so i used the style variable with a prompt value to make sure the Style variable was working and it did hide the table - So i think there's something with using the Page Number () report function.

Thoughts on how i can do this?

Appreciate the help.

Bonnie

Title: Re: Use Page Number to conditionally display an object
Post by: blom0344 on 14 Jun 2008 01:22:31 PM
Perhaps you're making this harder than it should be.
Instead of using 1 report page, use 2 report pages.
In design do not define the table for the first report page, but just show what you want here..

Since report pages are displayed in consequetive order then the table (as defined in the 2nd report page) will start from the second displayed page onwards.
Title: Re: Use Page Number to conditionally display an object
Post by: bonniehsueh on 16 Jun 2008 06:36:32 AM
Thanks for the response. The thing with that way is that it increases the maintenance on the report since you will have to maintain the report in both pages.

Other ideas on doing this?

Thanks in advance

Title: Re: Use Page Number to conditionally display an object
Post by: blom0344 on 16 Jun 2008 07:49:27 AM
No, though using the page number in a condition may not be evaluated at all and is purely available for  displaying information on the page..
Title: Re: Use Page Number to conditionally display an object
Post by: Darek on 16 Jun 2008 08:41:14 AM
Correct, the Page Number is not evaluated until the entire report is finished I believe. That's why so often you see a question mark instead. If you know how many records fit on the first page, than you could try to use a rownumber function instead.
Title: Re: Use Page Number to conditionally display an object
Post by: blom0344 on 17 Jun 2008 02:17:16 AM
Quote from: bonseye on 16 Jun 2008 06:36:32 AM
Thanks for the response. The thing with that way is that it increases the maintenance on the report since you will have to maintain the report in both pages.

Other ideas on doing this?

Thanks in advance



From a maintenance standpoint it would require perhaps more work, but from the report design it will be obvious to anyone else how the report works.
Your concept of hiding things on the first page is surely more sophisticated, but who will know this concept when you have left the company?
Title: Re: Use Page Number to conditionally display an object
Post by: rockytopmark on 17 Jun 2008 08:39:29 AM
I agree with Blom... the 2 pages strategy is actually a much simpler design from a maintenance standpoint.

What part about having a 2nd page do you feel makes maintenance harder?  Perhaps we can offer ways to alleviate that position...
Title: Re: Use Page Number to conditionally display an object
Post by: bonniehsueh on 20 Jun 2008 09:23:49 AM
That is a good point. Aruging the maintenability aspect, the row count technique is more sophisticated but unless documented is not easily seen just by looking at the report and the client may spend more time figuring the report out than just having to copy and paste report pages whenever Chagnes are made. Thanks for emphasizing the point.