通过Cognos 10.x中的URL传递数据源连接值

时间:2016-12-06 14:20:27

标签: datasource cognos cognos-10

我有一个包含多个连接的数据源。我需要将数据源连接作为URL中的参数传递,以便在运行时选择连接。目前,我得到一个选择连接值的提示页面。我不希望显示提示页面,而是应该从URL获取连接值并继续运行报告。 我目前的连接格式如下。

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

如果对此有任何帮助,我将不胜感激?

1 个答案:

答案 0 :(得分:0)

你走在正确的轨道上......你只需要编码你的&lt ;,&gt;,“,[,]和'。

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

或变量

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