Hello,
I am trying to Remap a Webi report using Java SDK in SAP BO 4.2 SP2.
Java version used is SDK 7 Update 45.
Also i am using Eclipse (Mars 2) IDE to develop.
I have used the following query and included all the requisite Jars, and Classes but i am getting several errors,
Can someone look into the Code and say if i am doing something Wrong here:
Part that is not Working is mentioned below:
"
try{
ReportEngines boReportEngines = (ReportEngines) enterpriseSession.getService("ReportEngines");
ReportEngine boReportEngine = (ReportEngine) boReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
DocumentInstance boDocumentInstance = boReportEngine.openDocument(boReport.getID());
DataProvider boDataProvider = null;
// Now loop through all the dataproviders for the Webi report
for (int j=0; j<boDocumentInstance.getDataProviders().getCount(); j++)
{
boDataProvider = boDocumentInstance.getDataProviders().getItem(j);
String providerName = boDataProvider.getName();
String univName = boDataProvider.getDataSource().getName();
// Query for Production universes
String query_Produniverse = "SELECT SI_NAME, SI_CUID, SI_SHORTNAME FROM CI_APPOBJECTS WHERE SI_Kind = 'Universe' AND SI_NAME='" + univName + "' and SI_TENANT_ID ="+tenantID +"and SI_PARENT_FOLDER ="+parentProdID;
IInfoObjects boInfoObjects_universe = (IInfoObjects) infoStore.query(query_Produniverse);
// Query for Test universes to be taken in case no prod universe is found
String query_Testuniverse = "SELECT SI_NAME, SI_CUID, SI_SHORTNAME FROM CI_APPOBJECTS WHERE SI_Kind = 'Universe' AND SI_NAME='" + univName + "' and SI_TENANT_ID ="+tenantID +"and SI_PARENT_FOLDER ="+parentTestID;
if (boInfoObjects_universe.size() > 0) {
IUniverse boUniverse = (IUniverse) boInfoObjects_universe.get(0);
String newUniverseId = "UnivCUID=" + boUniverse.getCUID() + ";UnivName=" + boUniverse.getShortName();
boDocumentInstance.getDataProviders().changeDataSource(boDataProvider.getDataSource().getID(), newUniverseId, false);
} else {
boInfoObjects_universe = (IInfoObjects) infoStore.query(query_Testuniverse);
IUniverse boUniverse = (IUniverse) boInfoObjects_universe.get(0);
String newUniverseId = "UnivCUID=" + boUniverse.getCUID() + ";UnivName=" + boUniverse.getShortName();
boDocumentInstance.getDataProviders().changeDataSource(boDataProvider.getDataSource().getID(), newUniverseId, false);
}
}
if (universeChanged) {
boDocumentInstance.save();
}
boDocumentInstance.closeDocument();
} catch (Exception e) {
System.out.println("Error:" + e);
}
}
}
infoStore.commit(boInfoObjects);
}"
all parameters like tenantID, parentTestID, parentProdID have been initiallised and are retrived properly without any errors so i did not include the code for those Objects.