COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 25 Mar 2014 03:41:01 AM

Title: Difference between style variable and render variable
Post by: inu on 25 Mar 2014 03:41:01 AM
Hi
Please exaggerate the difference betweeen Style Variable and render variable, when we use style variable , and when we need to use render variable. Which one is better.

Please give the example

Regards
Inam
Title: Re: Difference between style variable and render variable
Post by: MFGF on 01 Apr 2014 10:08:34 AM
Hi

A Style Variable is a variable based on which an object can be conditionally styled.
A Render Variable is a variable based on which an object can be conditionally rendered.

Use a style variable when you want to control the style (font, colour, border etc) of an object conditionally
Use a render variable when you want to render (show/hide) an object conditionally

Neither is better. They each have a puropse. Use the appropriate type of variable for the appropriate task.

I'd humbly suggest you would benefit from some Cognos 10 Report Studio training. These kinds of basics are covered in the course and I'm sure you would learn a lot to help you in your role.

Cheers!

MF.
Title: Re: Difference between style variable and render variable
Post by: Enrique on 21 Mar 2016 10:08:37 AM
Hi @MFGF !!


untill now i was doing (show/hide) an object conditionally with a "Style variable" (type box none..) and worked perfect since a while i asked myself about that , why exist both ?

After googling for a while , i can not find the different between both , but the guys of IBM dont seem to be kind of people that make things without porpuse.. so i wonder what can you do with Render variable that you can not do with Style variable and vice versa


If anyone have any Idee  would be nice to hear it   :))

thanks in Advance, Enrique
Title: Re: Difference between style variable and render variable
Post by: cognos-t on 22 Mar 2016 03:26:37 AM
Hi Enrique,

render variables can be used on elements without a connection to a query. For example: If you want to render pages conditionally based on user's choise via prompt, render variables do the trick. Other examples are the conditional rendering of an object linked to the same data query (e.g. you want to display a list in excel - but you want to visualize the same data in a chart when the report is run in HTML) or the usage of images based on the output format (replacement of image by text when a report is executed in excel)

The main difference between render and style variables is the fact that render variables control if an object is rendered while style variables control how a constant object is rendered (in terms of font, border, etc).

Regards