%@ language=JavaScript %>
View the latest instance of a report
<%
function Main()
{
//Set the logon information for the APS
var UserID, Password, APS;
//Set the ID of the report you want to view the latest instance
var reportID;
// reportID comes from ce90..APS_InfoObjects2.ObjectID
// a scheduled report will have the original version of the report as its ParentID
reportID = "1000";
// server name
APS = "myserver";
UserID = "guest";
Password = "";
Response.Expires = 0;
var SessionManager;
try
{
// Create an Enterprise SessionManager.
SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr");
}
catch(e)
{
Response.Write ("Couldn't create SessionManager");
// handle error
return;
}
var Sess;
try
{
// Log the user onto Crystal Enterprise
Sess = SessionManager.Logon(UserID, Password, APS, "secEnterprise");
}
catch(e)
{
// Check to see if the logon failed.
// If the logon failed show a message box with an error description.
Response.Write ("");
// Redirect the user back to the logon page.
//Response.Write ("");
Response.Write("");
Response.Write("");
Response.Write("");
Response.Write("");
Response.Write("\n");
Response.Write("");
Response.Write("");
}
Main();
%>