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

[RS] Conditionally hiding an entire list

Started by JGirl, 20 Feb 2006 08:28:45 PM

Previous topic - Next topic

JGirl

Hi Guys,

Im relatively new to conditional formatting (and even newer to Cognos8).  I've searched through this forum and the ReportNet one, but there isnt quite enough detail in other postings for me to figure out what is wrong, particularly when I have NO IDEA what is causing my dramas (apart from my lack of knowledge)

I have a sample report created from the Go Sales and Retailers package.  When the list is empty, I want to hide the whole lot (headers and all).  I've created a report with a list, included a count of the records in the query, and created a boolean variable based on the record count.  When the record count is 0, I've tried to set the list box type to none, and leave it as is when the record count is not 0.  But im getting an error when I run the report:

" An error on or around the position '0'. The variable named '[Query1].[Data Item1]' is invalid. "

I'm not sure what the syntax of my variable condition should be.

Can someone please take a look at my report (attached) and point me in the right direction??

Note: Running the report for 'Advanced Climbing Limited' should return a blank page as there is no data for this retailer.

J

rmark17

I ran into the same "error around position 0" error when I used a calculation that counted a field for report such as count(X for report). As a workaround I added a calc that simply has the value 1 and totaled that field total( x for report) and the error went away.

To conditionally hide the list:

Note: Conditional blocks only work in data containers (Lists, crosstabs, repeater tables), and for some reason the page is not considered a data container. This is why you need the repeater table in this technique.

Add a Repeater table to your page
Set the rows and columns attributes to 1 X 1.
Add a conditional block to the Repeater cell.
Set the block variable for the conditional block to your variable.
Add or move your list into the conditional block.

Tip: To easily see which value of your Yes/No variable will show the list, view the report in Page Structure mode (View/Page Structure) and the list should show under the appropriate condition value. 



mayank_sanghvi

#2
Hi,

If you want to hide the list only then you can use no data content. Set it's value to blank.

If you want to hide page if list don't have any data and your page having single list. If yes then why not use "Render Page When Empty" to NO. (This solution is not going to work if your report page having more than 1 list.

Alternative if you are using variable then you need to add your query at page level (the same query used for calculating the count).

Let me know if this two points help to solve your scenario.


MFGF

Quote from: mayank_sanghvi on 17 Nov 2016 05:05:45 AM
Hi,

If you want to hide the list only then you can use no data content. Set it's value to blank.

If you want to hide page if list don't have any data and your page having single list. If yes then why not use "Render Page When Empty" to NO. (This solution is not going to work if your report page having more than 1 list.

Alternative if you are using variable then you need to add your query at page level (the same query used for calculating the count).

Let me know if this two points help to solve your scenario.

You are answering a question asked more than a decade ago. I imagine if it isn't solved by now it is no longer important. Thanks for taking the time to answer, but I doubt you'll hear from the original poster...

MF.
Meep!