In the next part of the code, the InfoStore
object is retrieved using the RetrieveIstore
function.
If RetrieveIStore(IStore)=FALSE then
Response.Redirect "LogonForm.htm"
Response.Write "<B>Folders</B><BR><BR>"
If the RetrieveIStore
function fails, then there is a rather large problem: there is no way to authenticate the current user. Thus, the only option available is to redirect the user back to the logon page. If the RetrieveIstore
function succeeds, then the folders are displayed for the authenticated user.
'Retrieve the child folders for the current folder.
Result = RetrieveChildFolders(IStore,CurrentFolderID,FolderNames,FolderIDs)
'Check to see if the function was successful.
'Retrieve the parent's ID for the current folder.
Result = RetrieveParentID(IStore,CurrentFolderID,ParentID)
'Check to see if the query was successful.
'If this is not the top level of folders display the "Up a Level" link.
If Not IsEmpty(ParentID) And (CurrentFolderID<>0) Then
Response.Write "<A HRef='home.csp
'If there are sub
If Not isEmpty(FolderNames) Then
For k = 1 to UBound(FolderNames)
Response.Write "• " & "<A HRef='home.csp
Server.HTMLEncode(FolderNames(k)) & "</A><BR>"
Response.Write "No Sub
Response.Write "There was an error trying to retrieve the parent folder."
Response.Write "There was an error trying to retrieve the sub
The most interesting lines in this slice of code are the two responses:
Response.Write "<A HRef='home.csp
and
Response.Write "<A HRef='home.csp
Server.HTMLEncode(FolderNames(k)) & "</A><BR>"
The first displays a link that returns the user to a folder one level up in the folder tree, and the second displays a link to one of the sub
<a href='Home.csp
The link instructs the page Home.csp to be loaded. This page hasn't been discussed yet, but it is important in that it provides the frames definition for a home page. It divides the browser window into three separate frames and loads the Folders pages into the left most frame. See Home Page.
The CurrentFolderID
is given to the frames page so that it can pass it on to both the Folders.csp page and the Reports.csp page, which you will examine shortly. Consequently, both the Folders page and the Reports page are loaded with a new folder ID
and display both the sub
To give you a better idea of how the folders page works, here is the HTML code that was produced by the Folders page at the top level of the myAPS folder tree.
<a href='home.csp
<a href='home.csp
There are two top
You now have a working copy of Folders.csp. To see a full version of the CSP page that you've created, see Folders.csp
Lesson 2b: Listing the reports in a folder
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |