At this point, you should have a general idea about how to check for and retrieve the InfoStore
object. Create a new CSP page and save it as RetrieveIStore.csp
. Add the following function.
To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.
<!-- #include file=helper_js.csp -->
//Returns the InfoStore object that allows you to query the server.
//The function returns null if it does not succeed.
LogonToken = GetCookie("LogonToken")
//Check to see if a logon token was really retrieved.
//Check to see if the InfoStore already exists.
if( typeof(Session.Value("IStore").Item) != "object" )
SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr");
//Logon using the token. This may fail if the token is no longer valid.
Sess = SessionManager.LogonWithToken(LogonToken);
//Create the InfoStore object.
IStore = Sess.Service("", "InfoStore");
//Save the InfoStore in the session.
//The InfoStore already exists so simply retrieve it from
Since you must have the InfoStore
object to query the APS, you will want to include the RetrieveIStore
function on any page that retrieves folders, reports, and/or report instances. You can do this by using a Server Side Include (SSI) statement such as the following:
<!-- #include file=RetrieveIStore.csp -->
Note: Server Side Includes are supported by ASP/CSP. They are essentially the same as normal include files found in C and C++ programming environments. For more information, please refer to an ASP programmer's guide.
Lesson 2a: Navigating through folders
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |