The main CSP page defines the frames for the viewer, and loads both the viewer and the toolbar from your custom desktop. It accepts a minimum of one parameter: the ID of the report you wish to view. Create a new text file called MyViewer.CSP and save it. The page may look something like this.
<META HTTP
<!-- #include file=helper_js.csp -->
<title>Crystal Report Viewer</title>
<SCRIPT src="htmlviewer.js"></SCRIPT>
<frameset frameborder="0" rows="64,*" >
<frame name="CrystalViewerToolbar" src="MyToolbar.html">
var SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr");
// Enter your own user ID here.
// Enter your own password here.
// Enter your own APS name here.
var Sess = SessionManager.Logon(UserID,Password,APS,Aut);
// Retrieve the report id from the URL string.
ReportID = Request.QueryString("ReportID");
// Load the viewer with the Report ID
Response.Write("<frame name='CrystalViewerPreview' src='viewrpt.cwr
"cmd=preview_page&incomplete_page_count=1&viewer=html_frame& " +
"vfmt=html_frame&page=1&brch=&drillname=&subrpt=&id=" & cstr(ReportID) + "&APSToken=" +
Sess.LogonTokenMgr.CreateLogonToken(APS,300,300) & "'>");
This page accomplishes three important things:
This file will be the one that your custom desktop calls when loading your custom viewer. For example, a link in your custom desktop may read as follows.
<A HREF='MyViewer.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |