on 05-06-2011 7:59 AM
hi,
I need a java code to get the Id of all webi reports in a folder and recursive sub folders .
Is there any sample code or tutorial available for It?
regards,
nitin
Actually, a better query might be:
SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='WebI' AND SI_ANCESTOR=<search folder SI_ID>
SI_ANCESTOR should be set to the SI_ID of a folder that is the "root" for your search. It will return all objects of SI_KIND='kind' that is a child of SI_ANCESTOR, including all sub-folders.
HTH.
Edited by: codeguru on Aug 22, 2011 5:54 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didn't test this but it should work. Import required packages.
<%
String username = "administrator";
String password = "<password>";
String cmsname = "<cmsname>";
String authtype = "secEnterprise";
IEnterpriseSession oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authtype);
IInfoStore oInfoStore = (IInfoStore)oEnterpriseSession.getService("","InfoStore");
getWebi(oInfoStore,0,out);
oEnterpriseSession.logoff();
%>
<%!
public void getWebi(IInfoStore oInfoStore, int sourceFolderID, javax.servlet.jsp.JspWriter out)
{
try
{
String query = "select * from ci_infoobjects where si_kind='webi' and si_instance =0 and si_parentid =" + sourceFolderID ;
IInfoObjects oInfoObjects = oInfoStore.query(query);
for(int i=0;i< oInfoObjects.size(); i++)
{
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
out.println(oInfoObject.getID() + " " + oInfoObject.getTitle() +"<br>");
}
String query = "select * from ci_infoobjects where si_kind='folder' and si_parentid = " + sourceFolderID ;
oInfoObjects = oInfoStore.query(query);
for(int i=0;i< oInfoObjects.size(); i++)
{
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
getWebi(oInfoStore, oInfoObject.getID(), out);
}
}
catch(SDKException e)
{
out.println(e.toString());
}
}
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.