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

Global Variables

Started by Bonediggler, 19 Aug 2014 01:11:01 PM

Previous topic - Next topic

Bonediggler

Experts -

Is there a way to use "global" variables in Report Studio?  For example if I have 3 queries in a report, each of which uses a date range...could I set the date range to be between @Var1 and @Var2 for all 3 queries ?

(and just change the variables instead of each query)

Thank you!

bdbits

Drag a text box prompt onto your report, name your parameter, and uncheck "Create a parameterized filter". In the prompt control's properties, define the default selection to whatever value you want to use. Now in each of your queries, you can define a filter that uses that parameter in the expression. So let us say you called the parameter "p1", then your filter expression might be "[SomeColumn]=?p1? for one query and "[AnotherColumn]=?p1?" in a second query.

When you want to change the filter value, update the parameter's default selection. When everything looks like it is working, set the prompt control "Box type" to "None" so it is not rendered on the report. To get it visible again, like when you want to change the default, in Report Studio choose menu item View > Visual Aids > Show Hidden Objects.

As a side benefit, note that if you leave it visible while developing the report, you can use the text box to test different values for your filter selections.