To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.
<META HTTP
<link REL=STYLESHEET TYPE='text/css' HREF='tut.css'>
<!-- #include file=helper_js.csp -->
<!-- #include file=RetrieveIStore.csp -->
function PrintChildFolders(IStore, ParentID)
// This function prints the names of child folders in a given folder.
//IStore - The InfoStore object required to interface with server.
//ParentID - The ID of the parent folder containing the children to be retrieved.
//If an error occured the function returns false, otherwise it returns true.
//The query that will select all the child folders.
//Create a query that selects all the folders for a particular object.
//SI_PARENT_FOLDER is used to identify the parent folder.
//SI_PROGID = 'CrystalEnterprise.Folder' specifies that we only want folders back.
Query = "Select SI_NAME, SI_ID From CI_INFOOBJECTS Where " +
"SI_PROGID = 'CrystalEnterprise.Folder' And SI_PARENTID=" + ParentID;
//There was an error querying the server.
//Check that there are folders to view.
//Retrieve the folder IDs from the query result.
Response.Write ("<LI>" + "<A HRef='Home.csp
Server.HTMLEncode(Result.Item(k).Title) + "</A><BR>");
} else Response.Write ("No Sub
function RetrieveParentID(IStore, ChildID)
//This function retrieves the ID number of a particular folder's
//IStore - The InfoStore object required to interface with server.
//ChildID - The ID of the child whose parent ID is to be retrieved.
//Returns the ID of the parent.
//If an error occured the function returns null.
//The query that will select all the child folders.
//Create a query that selects the parent's ID for a folder.
Query = "Select SI_PARENTID From CI_INFOOBJECTS Where SI_ID = " +
ChildID + " And SI_PROGID = 'CrystalEnterprise.Folder'";
//There was an error querying the server.
//Retrieve the ID from the query result.
return( Result.Item(1).ParentID);
function RedirectWithFrames(URL)
Response.Write ("<script language=javascript>open (\""+URL+"\",\"_top\");</script>");
//Retrieve the CurrentFolderID from the file's parameter list.
CurrentFolderID = Request.QueryString.Item("FolderID");
//Try to retrieve the InfoStore object.
//If it failed redirect the user to the logon page.
RedirectWithFrames("LogonForm.csp");
//Otherwise display the folders and the "Up a Level" link.
Response.Write ("<B>Folders</B><BR><BR>");
//Retrieve the parent's ID for the current folder.
ParentID = RetrieveParentID(IStore,CurrentFolderID);
//Check to see if the query was successful.
//If this is not the top level of folders display the "Up a Level" link.
Response.Write ("<A HRef='Home.csp
Response.Write ("There was an error trying to retrieve the parent folder.");
Result = PrintChildFolders(IStore,CurrentFolderID)
Response.Write ("There was an error trying to retrieve the sub
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |