2016-12-06 57 views
1

我有一個具有多個連接的數據源。我需要將數據源連接作爲參數傳遞給URL以在運行時選擇連接。目前,我得到一個提示頁面來選擇連接值。我不希望提示頁面出現,而是應該從URL中獲取連接值並繼續運行報告。 我目前的連接格式如下。在Cognos 10.x中通過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 

如果對此有幫助,我將不勝感激?

回答

0

你是在正確的軌道上..你只需要編碼您<,>,」,[,],和」。

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%[email protected]=%27datasourcename%27%5D/dataSourceConnection%[email protected]=%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%[email protected]=%27" + datasourcename + "%27%5D/dataSourceConnection%[email protected]=%27" + datasourceconnectionname + "%27%5D%3C/dataSourceConnection%3E%3CdataSourceSignon/%3E%3Cusername%3E" + username + "%3C/username%3E%3Cpassword%3E" + password +"%3C/password%3E%3C/credential%3E