1

I have a data source with multiple connections.I need to pass Data source connection as a parameter in the URL to select the connection at run time. Currently I get a prompt page for choosing the connection value. I don't want the prompt page to appear, Instead it should take the connection value from URL and continue running the report. My current connection format as below.

http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&
ui.action=run&ui.object=ui_object&p_credential:dataSourcename:password=<credential><dataSourceConnection>CAMID(":")/dataSource[@name='datasourcename']/dataSourceConnection[@name='datasourceconnectionname']</dataSourceConnection><dataSourceSignon/><username>xxxx</username><password>yyy</password></credential>&run.outputFormat=&run.prompt=false

I would appreciate if any help on this?

mohammed sameen
  • 1,368
  • 1
  • 13
  • 39

1 Answers1

0

You are on the right track.. you just need to encode your <, >, ", [, ], and '.

http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=ui_object&run.outputFormat=&run.prompt=false&p_credential:dataSourcename:password=%3Ccredential%3E%3CdataSourceConnection%3ECAMID(%22:%22)/dataSource%5B@name=%27datasourcename%27%5D/dataSourceConnection%5B@name=%27datasourceconnectionname%27%5D%3C/dataSourceConnection%3E%3CdataSourceSignon/%3E%3Cusername%3Exxxx%3C/username%3E%3Cpassword%3Eyyy%3C/password%3E%3C/credential%3E

or with variables

http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=ui_object&run.outputFormat=&run.prompt=false&p_credential:" + dataSourcename + ":password=%3Ccredential%3E%3CdataSourceConnection%3ECAMID(%22:%22)/dataSource%5B@name=%27" + datasourcename + "%27%5D/dataSourceConnection%5B@name=%27" + datasourceconnectionname + "%27%5D%3C/dataSourceConnection%3E%3CdataSourceSignon/%3E%3Cusername%3E" + username + "%3C/username%3E%3Cpassword%3E" + password +"%3C/password%3E%3C/credential%3E
gman
  • 129
  • 1
  • 14