Enterprise version: 8.5
Viewer: ActiveX
The problem occurs when using a hyperlink in a report as the subsequent report opens in the DHTML viewer not the default ActiveX. The second report opens in a new window as this is a requirement.
Can anyone advise as to the setting/changes I need to make in order for the correct viewer to be used?
CSP code being used for hyperlinks is below.
Any assistance or ideas are greatly appreciated as I'm stumped.
Thanks.
Sijeffs
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY>
<%@ language=JavaScript codepage=65001%>
<!-- #include file="setcodepage.csp" -->
<!-- #include file="helper_js.csp" -->
<!-- #include file="globals.csp" -->
<!-- #include file="handleerror_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<%
// PREVENT BROWSER FROM CACHING THE PAGE
SetPageExpiry();
// CHECK FOR SESSION
var iStore = CheckSession(true);
//****************************************************************************
// Declare Variables.
var MyReportID;
var MyQuery;
var MyReportColl;
var MyReport;
var MySchedulingInfo;
var Rptname;
var last_instance;
var MyInstance;
var MyInstanceID;
var token = GetCookie("ePortfolio_logontoken");
//****************************************************************************
try {
//get the reportid and paramname
Rptname = Request.QueryString.Item("rpt");
//Response.Write ("rpt = "+Rptname+"<br>");
// Query the InfoStore for the report object.
MyQuery = "SELECT SI_ID, SI_LAST_SUCCESSFUL_INSTANCE_ID FROM CI_INFOOBJECTS WHERE SI_INSTANCE=0 AND SI_NAME='"+Rptname+"'";
MyReportColl = iStore.Query(MyQuery);
MyReport = MyReportColl.Item(1);
try {
last_instance = MyReport.Properties.Item("SI_LAST_SUCCESSFUL_INSTANCE_ID");
var iquery = "SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_ID ="+last_instance;
MyReportColl = iStore.Query(iquery);
MyInstance = MyReportColl.Item(1);
MyInstanceID = MyInstance.ID;
//now view the report
//Response.Redirect ("viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID);
Response.Write ("<script language='javascript'>");
Response.Write ("window.parent.parent.location='viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID+"'");
Response.Write ("</script>");
}
catch(ex)
{
Response.Write ("No successful instance to view <BR>");
Response.Write (ex.description);
Response.End();
}
}
catch(e)
{
Rptname = Request.QueryString.Item("rpt");
Response.Write ("Error drilling down on report");
Response.End();
}
%>
</BODY>
</HTML>
Viewer: ActiveX
The problem occurs when using a hyperlink in a report as the subsequent report opens in the DHTML viewer not the default ActiveX. The second report opens in a new window as this is a requirement.
Can anyone advise as to the setting/changes I need to make in order for the correct viewer to be used?
CSP code being used for hyperlinks is below.
Any assistance or ideas are greatly appreciated as I'm stumped.
Thanks.
Sijeffs
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY>
<%@ language=JavaScript codepage=65001%>
<!-- #include file="setcodepage.csp" -->
<!-- #include file="helper_js.csp" -->
<!-- #include file="globals.csp" -->
<!-- #include file="handleerror_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<%
// PREVENT BROWSER FROM CACHING THE PAGE
SetPageExpiry();
// CHECK FOR SESSION
var iStore = CheckSession(true);
//****************************************************************************
// Declare Variables.
var MyReportID;
var MyQuery;
var MyReportColl;
var MyReport;
var MySchedulingInfo;
var Rptname;
var last_instance;
var MyInstance;
var MyInstanceID;
var token = GetCookie("ePortfolio_logontoken");
//****************************************************************************
try {
//get the reportid and paramname
Rptname = Request.QueryString.Item("rpt");
//Response.Write ("rpt = "+Rptname+"<br>");
// Query the InfoStore for the report object.
MyQuery = "SELECT SI_ID, SI_LAST_SUCCESSFUL_INSTANCE_ID FROM CI_INFOOBJECTS WHERE SI_INSTANCE=0 AND SI_NAME='"+Rptname+"'";
MyReportColl = iStore.Query(MyQuery);
MyReport = MyReportColl.Item(1);
try {
last_instance = MyReport.Properties.Item("SI_LAST_SUCCESSFUL_INSTANCE_ID");
var iquery = "SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_ID ="+last_instance;
MyReportColl = iStore.Query(iquery);
MyInstance = MyReportColl.Item(1);
MyInstanceID = MyInstance.ID;
//now view the report
//Response.Redirect ("viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID);
Response.Write ("<script language='javascript'>");
Response.Write ("window.parent.parent.location='viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID+"'");
Response.Write ("</script>");
}
catch(ex)
{
Response.Write ("No successful instance to view <BR>");
Response.Write (ex.description);
Response.End();
}
}
catch(e)
{
Rptname = Request.QueryString.Item("rpt");
Response.Write ("Error drilling down on report");
Response.End();
}
%>
</BODY>
</HTML>