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 RetrieveFullPath(FolderID, IStore)
//This function returns an HTML string that provides links
//to all of the parent folders for the current folder.
//The root folder is called 'Home'.
//FolderID - The ID of the folder currently being viewed.
//IStore - The InfoStore object required to interface with server.
//Success - True if no error, False otherwise.
//Returns an empty string on error.
//The function returns an HTML string
//This is the root folder. It has no name, so we will call it 'Home'.
return("<a href='Home.csp
//A query that selects the parent folder's ID.
Query = "Select SI_PATH, SI_NAME From CI_INFOOBJECTS Where " +
//There was an error querying the server.
//Just in case something went wrong, check to see that you have a folder.
//The number of parent folders.
NumFolders = Result.Item(1).Properties.Item("SI_PATH").Properties.Item("SI_NUM_FOLDERS");
//The HomeLink variable is used to prefix the complete path with a link to the root folder.
HomeLink = "<A HRef='Home.csp
//The full path must at least include the folder you are in.
CurrentName = Server.HTMLEncode(Result.Item(1).Title);
//This variable represents the current folder.
CurrentFolder = "<A HRef='Home.csp
FullPath = HomeLink + " / " + CurrentFolder;
//This loop retrieves all the current folders' parent folders and concatenates them into
//a complete path of hyperlinks to each of the folders.
for (k = 1;k <= NumFolders;k++)
ParentId = Result.Item(1).Properties.Item("SI_PATH").Properties.Item("SI_FOLDER_ID" + k);
ParentName = Result.Item(1).Properties.Item("SI_PATH").Properties.Item("SI_FOLDER_NAME" + k);
ParentName = Server.HTMLEncode(ParentName);
FullPath = "<A HRef='Home.csp
ParentName + "</A>" + " / " + FullPath;
//Now that you have a complete path of the parent folders to the current folder,
//create the full path prefixed with the home link and suffixed with the current folder link.
FullPath = HomeLink + " / " + FullPath + CurrentFolder;
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");
Response.Write ("<TABLE Width='100%'><TR>");
//Try to retrieve the InfoStore object.
//If it failed, redirect the user to the logon page.
RedirectWithFrames("LogonForm.csp");
FolderPath= RetrieveFullPath(CurrentFolderID, IStore,Success);
Response.Write ("<TD>" + FolderPath + "</TD>");
Response.Write ("There was an error trying to retrieve the full path of the folder.");
//Write the link to the search page.
Response.Write ("<TD Align='right'><A HRef='SearchForm.csp' Target='Main'>Search</A></TD></TR>");
Response.Write ("<TR><TD></TD><TD Align='right'><A href='Logoff.csp' Target='_top'>Logoff</A></TD></TR></TABLE>");
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |