COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bloggerman on 29 Nov 2010 12:15:24 AM

Title: Conditional Blocks vs Render Variable
Post by: bloggerman on 29 Nov 2010 12:15:24 AM
I have a requirement where i need to show a chart if user chooses chart as prompt option and crosstab if crosstab is chosen.
I know that recommended way to implement it is to use Conditional Blocks. But, i was thinking would it be ok to just put a table and
put render variables to hide and show. Waht would be the pros and cons of the two?

Second, when i use render variable the part that is hide doesnt become part of the report and doesn't use space in
the report. Does that mean it helps performance, technically, if not a lot, but, a little, atleast?
Title: Re: Conditional Blocks vs Render Variable
Post by: ksr on 29 Nov 2010 12:43:17 AM
Rt...

using render variable absoulty improve the performance, because the particular object will be dropped during execution with out executing, so some span of time will be saved..
Title: Re: Conditional Blocks vs Render Variable
Post by: bloggerman on 29 Nov 2010 02:11:11 AM
Thanks. Could you also shed some light on the first part.
Title: Re: Conditional Blocks vs Render Variable
Post by: ksr on 29 Nov 2010 03:06:06 AM
The object we put in conditional blocks will be executed during execution of the report irrespective of the conditional block and current block values. during the presentation of the report, it checks the conditional block and current block, and based on the result of current block, the respective block and its contents will be displayed. So, here execution of all blocks will be happened even though only one block will be shown in the report. I thinkthis is overhead
Title: Re: Conditional Blocks vs Render Variable
Post by: bloggerman on 29 Nov 2010 04:02:01 AM
Pardon my ignorance, but, what do you mean by Current block. Is that the container of the conditional block?

And, how does the whole scenario defer from Render Variable usage on say a table? I am trying to figure the differ and the prefered way between render variable and conditional block.
Title: Re: Conditional Blocks vs Render Variable
Post by: ksr on 29 Nov 2010 05:01:20 AM
Properties of Conditional Block:

Block Variable: we may assign string variable for this property

(String variable may contain case statement or if .. else expression. The expression will be evaluated at run time and produces a value. If this value is matched with the value of current block property then that conditional block will be displayed..)

Current block: we set a value of string valiable
Title: Re: Conditional Blocks vs Render Variable
Post by: mrcool on 05 Apr 2011 08:04:57 PM
Hi Guru's,

Can some one please confirm that using of conditional blocks will not send multiple queries to DB.
I am using conditional block with 3 list reports . Each report will appear based on the value selected in the prompt. I want to know whether cognos will send 3 queries to DB or send only single query to DB which is corresponding to the value selected in the value prompt.
Iam using cognos 8.4

Thanks,
Mrcool.
Title: Re: Conditional Blocks vs Render Variable
Post by: PRIT AMRIT on 06 Apr 2011 02:41:18 AM
Will send only single query to DB which is corresponding to the value selected in the value prompt.
Title: Re: Conditional Blocks vs Render Variable
Post by: inu on 28 Sep 2014 01:27:05 AM
Quote from: ksr on 29 Nov 2010 03:06:06 AM
The object we put in conditional blocks will be executed during execution of the report irrespective of the conditional block and current block values. during the presentation of the report, it checks the conditional block and current block, and based on the result of current block, the respective block and its contents will be displayed. So, here execution of all blocks will be happened even though only one block will be shown in the report. I thinkthis is overhead

HI ksr,
Your replies cleared somewhat of my daughts, according to you, render variable executes only the selected object, while in conditional block, all the blocks are executed.
Then in what case should i use conditional block, and when render variable.

Thanks and regards
Inam
Title: Re: Conditional Blocks vs Render Variable
Post by: sunny bachan prasad on 01 Nov 2014 12:24:36 PM
Hi,
Can some body reply to INU question as I also have the same question. How to decide whether to go with render variable or conditional blocks.

Thanks in advance.
Title: Re: Conditional Blocks vs Render Variable
Post by: ajayhemanth on 01 Nov 2015 01:33:16 AM
Hi All,

I GUESS, if you want to display/hide many elements (a group of elements) based on a condition then go with conditional block.
If you want to display/hide just a single element based on a condition then go with render variable.
Please excuse if i'm wrong.

Regards
Ajay