文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>【BO-SDK】Retrieve parameter values _static prompts    

【BO-SDK】Retrieve parameter values _static prompts    

时间:2010-09-08  来源:xiangjinling

Retrieve parameter values (static)

连接参数

...

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();
}

相关阅读 更多 +
排行榜 更多 +
立体反应点击

立体反应点击

休闲益智 下载
料理物语

料理物语

休闲益智 下载
滑杆优雅舞者

滑杆优雅舞者

休闲益智 下载