In previous versions of BusinessObjects (6.5 and prior) application developers had the ability to purge saved data from Webi documents.
With the move to the Enterprise backend this functionality was not migrated over.
BusinessObjects Enterprise XI 3.1 has added this functionality back into the Java REBean SDK. You can now purge saved data from a Webi template as well as reset the prompt values that were used during the last refresh of the report.
bq. Entire code page in JSP<br /><textarea cols="75" rows="10"><%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import="com.businessobjects.rebean.wi.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession oEnterpriseSession = null;
String username = "Administrator";
String password = "MyPassword";
String cmsname = "localhost";
String authenticationType = "secEnterprise";
try {
//Log in.
oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (oEnterpriseSession == null) {
out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
} else {
loginSuccessful = true;
}
} catch (SDKException sdkEx) {
out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
}
if (loginSuccessful) {
IInfoObject oInfoObject = null;
String docname = "TestWebi";
//Grab the InfoStore from the httpsession
IInfoStore oInfoStore = (IInfoStore) oEnterpriseSession.getService("", "InfoStore");
//Query for the report object in the CMS. See the Developer Reference guide for more information the query language.
String query = "SELECT TOP 1 * " +
"FROM CI_INFOOBJECTS " +
"WHERE SI_INSTANCE = 0 And SI_Kind = 'Webi' " +
"AND SI_NAME='" + docname + "'";
IInfoObjects oInfoObjects = (IInfoObjects) oInfoStore.query(query);
if (oInfoObjects.size() > 0) {
//Retrieve the latest instance of the report
oInfoObject = (IInfoObject) oInfoObjects.get(0);
// Initialize the Report Engine
ReportEngines oReportEngines = (ReportEngines) oEnterpriseSession.getService("ReportEngines");
ReportEngine oReportEngine = (ReportEngine) oReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
// Openning the document
DocumentInstance oDocumentInstance = oReportEngine.openDocument(oInfoObject.getID());
DataProvider oDataProvider = null;
//Loop through dataproviders and purge data
for (int i=0; i<oDocumentInstance.getDataProviders().getCount(); i++) {
oDataProvider = oDocumentInstance.getDataProviders().getItem(i);
oDataProvider.purge();
// This option purges data as well as reset prompt values used during last refresh
//oDataProvider.purge(true);
}
oDocumentInstance.save();
oDocumentInstance.closeDocument();
}
oEnterpriseSession.logoff();
}
%>
</textarea>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
6 | |
6 | |
6 |