【BO-SDK】Retrieve parameter values _static prompts       (BOE SDK Java Applicati

Retrieve parameter values (static)[@more@]

连接参数

...

String reportName = "Sales Dashboard";
int reportID = 0;

// Logon and obtain an Enterprise Session
IEnterpriseSession boEnterpriseSession = null;
IInfoObjects boInfoObjects=null;
IInfoObject boInfoObject=null;
IInfoStore boInfoStore=null;

IReportSource boReportSource=null;
IReportSourceFactory boReportSourcefactoryPageServer=null;
try {
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsName, authType);
boInfoStore = (IInfoStore) boEnterpriseSession.getService("", "InfoStore");

//Query for the report and make sure that the report is an instance "SI_INSTANCE=0"
// boInfoObjects = (IInfoObjects) boInfoStore.query("Select * from CI_INFOOBJECTS Where " +
// "SI_NAME='" + reportName + "' And SI_INSTANCE=0" );

boInfoObjects = (IInfoObjects) boInfoStore.query("Select * from CI_INFOOBJECTS Where " +
"SI_ID='682627' And SI_INSTANCE=0" );
boInfoObject = (IInfoObject) boInfoObjects.get(0);
//SI_PROMPTS

IProperties prompts = (IProperties) boInfoObject.getProcessingInfo().properties().getProperty("SI_PROMPTS").getValue();
int num_prompts = ((Integer)prompts.getProperty("SI_NUM_PROMPTS").getValue()).intValue();

for(int i=1;i<=num_prompts ;i++)
{
IProperties prompt = (IProperties)prompts.getProperty("SI_PROMPT"+i).getValue();
String promptName = prompt.getProperty("SI_NAME").getValue().toString();
System.out.println("Prompt Name = "+promptName);
IProperties current_values = (IProperties)prompt.getProperty("SI_CURRENT_VALUES").getValue();
int num_values = ((Integer)current_values.getProperty("SI_NUM_VALUES").getValue()).intValue();
for(int j=1;j<=num_values ;j++)
{
System.out.println("num_values:"+num_values);
IProperties value = (IProperties)current_values.getProperty("SI_VALUE"+j).getValue();
if(value.size() == 3)
{
// Range Parameter : contains 3 properties: SI_MIN, SI_MAX, SI_OPTIONS
IProperties minRange = (IProperties)value.getProperty("SI_MIN").getValue();
String min_value = minRange.getProperty("SI_DATA").getValue().toString();
IProperties maxRange = (IProperties)value.getProperty("SI_MAX").getValue();
String max_value = maxRange.getProperty("SI_DATA").getValue().toString();
System.out.println("Range "+j+" Min Value "+min_value+" Max Value "+max_value);
}
else if (value.size() == 4)
{
// Discrete Parameter : contains 4 properties: SI_SHOWDESCONLY, SI_OPTIONS, SI_DESCRIPTION, SI_DATA
String param_value = value.getProperty("SI_DATA").getValue().toString();
System.out.println(" Value "+j+" = "+param_value);

}

}
System.out.println("一个参数的所有参数列表结束");

}




} catch (SDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

resserver.php?blogId=42444&resource=retrieve%20paravalue.JPG

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24167472/viewspace-1038061/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24167472/viewspace-1038061/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值