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.
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.
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.
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.
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.
Thanks for the feedback. I will give this a try and post back when I have it working.
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.
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