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_vb.zip. For more information about using the samples, see Code examples.
Function RetrieveIStore(IStore)
'IStore - Returns the InfoStore object that allows us to query the server.
'The function returns TRUE if successful and FALSE otherwise.
'Check to see if the cookie is there.
If( Request.Cookies("LogonToken") <> "" ) Then
'Check to see if the InfoStore already exists.
If( TypeName(Session("IStore")) <> "ISInfoStore" ) Then
LogonToken = Request.Cookies("LogonToken")
Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr")
'Logon using the token. This may fail if the token is no longer valid.
Set Sess = SessionManager.LogonWithToken(LogonToken)
Set IStore = Sess.Service("", "InfoStore")
'Save the InfoStore in the session.
'The InfoStore already exists so simply retrieve it from
Set IStore = Session("IStore")
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 |