COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Penny on 17 Jul 2014 11:50:25 AM

Title: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: Penny on 17 Jul 2014 11:50:25 AM
I am working with Cognos 10.2.1 FP3 Report Studio on a Windows Server 2012 machine using Oracle as our data source, and also as our content store.  Our data source is relational.

I am working in Report Studio and am having trouble trying to print the dataSource in the report footer.   I have created a query calculation containing

                                             #sq($dataSource)#

The $dataSource was inserted from the session parameters in the expression dialogue box.  It validates properly but nothing displays in the report.

I do have the report printing another session parameter in the same fashion and it works fine.

                                            #sq($account.defaultName)#

Can anyone point me in the right direction please?   Any help is appreciated.  Thank-you.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: MFGF on 17 Jul 2014 12:18:45 PM
Quote from: Penny on 17 Jul 2014 11:50:25 AM
I am working with Cognos 10.2.1 FP3 Report Studio on a Windows Server 2012 machine using Oracle as our data source, and also as our content store.  Our data source is relational.

I am working in Report Studio and am having trouble trying to print the dataSource in the report footer.   I have created a query calculation containing

                                             #sq($dataSource)#

The $dataSource was inserted from the session parameters in the expression dialogue box.  It validates properly but nothing displays in the report.

I do have the report printing another session parameter in the same fashion and it works fine.

                                            #sq($account.defaultName)#

Can anyone point me in the right direction please?   Any help is appreciated.  Thank-you.

Hi,

It sounds to me like the $datasource session parameter is empty? Have you verified that it actually contains something?

MF.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: Penny on 17 Jul 2014 01:10:15 PM
Hi MF

Unfortunately, I do not know how to confirm that it contains anything.  If I open the model in FM and look at Project -> Session Parameters, I don't see dataSource there but my understanding was that these parameters apply to the FM session itself.

I assumed (incorrectly I guess) that the session parameter for dataSource would be automatically populated for Report Studio.

My issue is that our production environment uses an Oracle database - PROD, and our development environment has access to multiple clones of the production database.  I have a requirement to always include the datasource in report header or footer.

Do you have any suggestions as to how I go about this?

Thank-you.

Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: navissar on 17 Jul 2014 01:41:13 PM
Here's what I'd do:
I'd set up a SP that returns the name you have for the database and writes that to a table, and set it up to run in session open command block.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: Lynn on 18 Jul 2014 10:21:22 AM
I think you can also query one of the system tables to get that information. Model that in your FM model to make it available to include on your report, perhaps in a singleton query container.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: Penny on 18 Jul 2014 01:18:37 PM
Thanks for the feedback.  I will give this a try and post back when I have it working.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: bi4u2 on 30 Jul 2014 11:41:58 AM
Penny - any progress on this? I am running into the same problem. I have a requirement to do some conditional formatting based on the datasource connection that is selected and it is returning nothing right now.
Title: Re: Session parameter $dataSource not displaying anything in Report Studio 10.2
Post by: Penny on 08 Aug 2014 12:16:48 PM
Hi There

No I have not finished this unfortunately.  We are working with an Oracle database and I can include a table in the model as suggested.  However the following bit of sql works great so I was going to try to incorporate this into my reports and/or model.  Haven't figured out how yet and off on holidays today.  I will get back to it in September.  In the meantime if you figure it out, please share.

                                SELECT SYS_CONTEXT('USERENV', 'DB_NAME') FROM DUAL;

Penny