Showing posts with label BOBJSDK. Show all posts
Showing posts with label BOBJSDK. Show all posts

How to retrieve document property in SAP BusinessObjects using BOE SDK?

Document properties inform us about document id, description, keywords, created and last modified dates and other meta-data information for that document.
Usage of these properties are quite wide.
I have used last modified date to get list of reports that are edited after a particular date. Also, in few custom web applications- I have shown an Information page that displays Document basic properties.
Today, I am talking how to retrieve general properties of a document. (Logic would be same for crystal or deski reports. Sample code is for webi report.)
(Schedule properties that provide information about scheduled instances, recurring instances, their timing, status etc. for a document are discussed here.
Same way, we have discussed Security information for a document here that is mainly user and group security on the document. )
In Business Objects UI env, we get document properties either from BI Launchpad or Query Builder.
Steps for BI Launchpad.
Steps for Query Builder (https://<server:port>/AdminTools).
·         BI Launchpad Steps
·         Login to BI Launchpad.
·         Navigate to document.
·         Right click and select “Properties”.
·         Open Query Builder using valid login credential.
·         Write SQL (below is sample query ) and run it.
SELECT SI_ID,  SI_CUID, SI_PARENTID, SI_KIND FROM CI_INFOOBJECTS WHERE SI_KIND = 'WebI' and SI_ID=386282


You will get associated property list for selected document.


ISessionMgr sessionManager = CrystalEnterprise.getSessionMgr();
IEnterpriseSession enterpriseSession = sessionManager.logon(sUsername, sPassword, sServer, sAuth);

sSuccessFailMsg = "You have successfully logged on! BOE version: " +enterpriseSession.getCMSName();
System.out.println( sSuccessFailMsg);

IInfoStore infostore = (IInfoStore) enterpriseSession.getService("InfoStore");
IInfoObjects docs = (IInfoObjects)infostore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='webi' AND SI_CUID='"+doc_cuid+"\'" );

IInfoObject doc = (IInfoObject)docs.get(0);

System.out.println(doc.getID() ); 
System.out.println(doc.getTitle() ); 
System.out.println(doc.getKind() ); 
System.out.println(doc.getOwner() );
System.out.println(doc.getDescription() );  
System.out.println(doc.getKeyword() );  
System.out.println(doc.properties().getProperty("SI_CONTENT_LOCALE") ); 
System.out.println(doc.properties().getProperty("SI_CREATION_TIME") ); 
System.out.println(doc.getUpdateTimeStamp() );