Quantcast
Channel: SCN : Unanswered Discussions - BI Platform
Viewing all articles
Browse latest Browse all 5661

Set "Use same database logon as when report is run" from SDK

$
0
0

Hi,

 

Is it possible to change the setting mentioned in the title via Java SDK?

 

Currently I am able to change it via CMC.

 

I found an example which has IReportLogon.setPromptOnDemandViewing(boolean promptOnDemand), the description of this method seems to be what I am looking for, however it doesn't change the setting after running the code below, everything else seems to have updated when I checked the report's Database Configuration on CMC. There is no error.

 

public static void changeDatabaseConfiguration(String reportName) {  IEnterpriseSession enterpriseSession=null;  try {  enterpriseSession=getEnterpriseSession();  IInfoStore infoStore=(IInfoStore)enterpriseSession.getService("InfoStore");  IInfoObjects infoObjects=infoStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_INSTANCE=0 and si_kind='CrystalReport'");  IInfoObject infoObject=null;  for (int i=0; i<infoObjects.size(); i++) {  infoObject=(IInfoObject)infoObjects.get(i);  if (infoObject.getTitle().equalsIgnoreCase(reportName)&&infoObject.getParent().getTitle().equalsIgnoreCase(CRS_USER_ID)) {  IReport rep=(IReport)infoObject;  ISDKList boReportLogons=rep.getReportLogons();  IReportLogon boReportLogon=(IReportLogon)boReportLogons.get(0);  boReportLogon.setOriginalDataSource(false);  boReportLogon.setCustomServerType(CeReportServerType.ORACLE);  boReportLogon.setCustomServerName(CRS_USER_ID);  boReportLogon.setCustomUserName(DB_USER_ID);  boReportLogon.setCustomPassword(DB_USER_PASSWORD);  boReportLogon.setPromptOnDemandViewing(false);  infoStore.commit(infoObjects);  }  }  } catch (Exception e) {  e.printStackTrace();  } finally {  if (enterpriseSession!=null) {  enterpriseSession.logoff();  }  }
}

Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>