COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Web2CRM on 30 Aug 2013 03:51:59 AM

Title: Do not connect to database on initial run
Post by: Web2CRM on 30 Aug 2013 03:51:59 AM
Hello Cognos Gurus,

I need some help about enhancing Cognos report performance.

I have a report that pulls whole year data, I have two filters in the report page with cascading prompt.

My concern is on how to set-up the report that pulls no data on initial run.  Any help will be much appreciated.  Thanks!!!
Title: Re: Do not connect to database on initial run
Post by: bdbits on 03 Sep 2013 02:39:23 PM
If I follow you correctly, you have in-line prompts and do not want the report to run until the prompts are selected.

Create a boolean variable that checks to see if the prompts are not null, for example:

  ParamValue('pMyPrompt') is not null

Then select your crosstab, list, or whatever report object. Make sure you have the object selected, and not something within. Then in the properties open Render Variable and select the boolean you created. Set it to render on "Yes".

So what will happen is when the report first runs, your in-line prompts will be null and the variable will equal "No". Since Cognos does not have to render the object on the page because you told it to render only for "Yes", it will not run the query. Once something has been selected and the report re-submitted, the prompt will no longer be null. The variable will equal  "Yes" and so Cognos will run the query and display the result.

Optionally, you may want to use the "No Data Contents" property to show something to the user when they open the report.