COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: nike.shah on 20 Mar 2014 06:32:29 PM

Title: Dynamically change Cognos data source connection using parameter maps ?
Post by: nike.shah on 20 Mar 2014 06:32:29 PM
Hi All,

I have several different database servers in different locations with same data structure. I have designed the cognos reports based on a database, So user who ever is loging into my portal(From the portal i am calling the cognos reports using CognosLaunch()), the respective database server is being changed and the respective data is being populated in my report. I am doing this by creating one data source and then define multiple connections under this single data source name. I have applied security to the connections so that users only have access to the single data source connection they should be using for the report. When the users are loging in they only have access to one connection so they are not being prompted to select a data source and each user is automatically use the connection they have been assigned for the report. Till this point everything works just fine, but there are internal users who has access to more than one client and they are being prompted to select data source connection every time they run the report. I have read somewhere that I can pass which client is being selected on my .net portal using "sessionvariable" and use it with Parameter map within FM to dynamically select data source connection. I am not sure how to approach this issue, so any guidance will be hugely appreciated !!

Thanks.
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: Lynn on 27 Mar 2014 10:20:31 AM
The attached is not exactly the thing you are asking, but perhaps similar enough to give you some ideas?
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: dinesh.pokale@tcs.com on 15 Jan 2015 06:54:46 AM
Hi CognosEnthu,

Did you got any solution to this, i am also having the same situation. pls let me know the solution?
i am using cognos 10.2.2
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: MFGF on 16 Jan 2015 06:24:37 AM
Quote from: DPTCS on 15 Jan 2015 06:54:46 AM
Hi CognosEnthu,

Did you got any solution to this, i am also having the same situation. pls let me know the solution?
i am using cognos 10.2.2

Did Lynn's attachment help you?

MF.
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: dinesh.pokale@tcs.com on 19 Jan 2015 03:56:53 AM
Lynn's Document is about the changing the schema dynamically but in my case schema's are same.

My case is :- i have 2 sets of user , one user is admin and another users are basically given access to the respective data connections.
so that works fine since it is not asking to choose the connection and also for admin who has access to all the data connections , cognos is prompting them to choose the connection which is also fine for me.
but, i just want to know how can we create the prompt to allow admin users to select the data connections, instead of cognos provided prompt?
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: bus_pass_man on 19 Jan 2015 08:10:37 PM
By 'cognos provided prompt' do you mean a prompt macro or the prompt you get where there's more than one database in the data source connection?

You could create a macro which uses a parameter map which looks up the user ID and substitutes a value for the ordinary users and a prompt macro for your admins.   
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: dinesh.pokale@tcs.com on 21 Jan 2015 05:51:26 AM
By 'cognos provided prompt' I meant the prompt you get where there's more than one database in the data source connection.

Also, where to create this prompt macro code. since, "content manager data source" property already have data source given.

Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: bus_pass_man on 21 Jan 2015 06:04:03 PM
You would put the macro into the content store data source name property, replacing the string which exists there.   You can do the same thing for the catalog and schema properties too.

That macro would look up the user ID of your user and substitute a value based on that.  The user id and values would be defined in a parameter map.  You can use the parameter map in the sample model and the macros which use it as examples.

For your users who are admins, you would have a prompt macro as the value in the parameter map. 

If you take the Framework Manager course you will get instruction on using macros.   Using the sample model as a guide should help get you part of the way.   

Here's the online help too.

http://www-01.ibm.com/support/knowledgecenter/SSEP7J_10.1.0/com.ibm.swg.im.cognos.ug_fm.10.1.0.doc/ug_fm_id18220project_reuse.html%23project_reuse?lang=en
Title: Re: Dynamically change Cognos data source connection using parameter maps ?
Post by: vetteheadracer on 10 Feb 2015 02:23:02 PM
You could do this with different database connections from the same Data Source.

Your user would get a dialog asking which database they want to connect to. For example DB 1, DB2, DB3

We do something similar with different releases of the same Database on the same server in development.