Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

This document provides a way get the File Repository location for crystal/webi reports using the BusinessObjects Enterprise Platform Java SDKs.


For more scripts and information on how to run these scripts refer to the blog avaiable here:

shawn.penner/blog/2013/06/04/scripts-and-samples

Below is the Java Server Pages (JSP) sample

Notes:

•You would need to change the userName, password, cmsName to the values specific to your enterprise server in the provided sample code.

• The sample code is tested with BI 4.0 and 4.1 version of SAP BusinessObjects Platform.

Get Report FRS Path

<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.exception.SDKException,
com.businessobjects.sdk.plugin.desktop.publication.*,
com.crystaldecisions.sdk.properties.*,
java.util.Set,
java.util.Iterator"
%>
<html>
<head></head>
<body>
<table border="2" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<th width="10%">Report ID</th>
<th width="30%"> Report Title</th>
<th width="30%"> Report Kind</th>
<th width="30%"> Report FRS Path</th>

<%


String userName = "administrator"; //adminstrator user account
String password = "password";  //administrator password
String cmsName = "localhost:6400"; //CMS server name
String authType = "secEnterprise";
String frsPathURL=null;
IEnterpriseSession enterpriseSession=null;
try {
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(userName, password, cmsName, authType);
IInfoStore infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");
String query = "select si_id,si_name,si_kind,si_files from ci_infoobjects where si_kind in ('crystalreport','webi') and si_instance=0";
IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query(query) ;
for(int i=0;i<oInfoObjects.size();i++)
{
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
IProperties props=oInfoObject.properties();

out.println("<tr><td>"+oInfoObject.getID()+"</td>");
out.println("<td>"+oInfoObject.getTitle()+"</td>");
out.println("<td>"+oInfoObject.getKind()+"</td>");
if(props.getProperty("SI_FILES") !=null)
{
IFiles reportFiles=(IFiles)oInfoObject.getFiles();
frsPathURL=reportFiles.getFRSPathURL();
out.println("<td>"+frsPathURL+"</td></tr>");
}
else
{
out.println("<td>SI_FILES Donot Exists</td></tr>");
}
}

}
catch(SDKException sdkEx) {
out.println(sdkEx);
}
finally
{
if(enterpriseSession !=null)
{
enterpriseSession.logoff();
}
}

%>

1 Comment
Labels in this area