Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlinked reports open in DHTML viewer when ActiveX is default

Status
Not open for further replies.

sijeffs

MIS
Feb 19, 2004
9
0
0
GB
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>
 
You may want to delete your cookies. I have found that even though you switch the browser on the Admin side it will not change until you delete the cookies.

 
cutiger93 / synapsevampire,

Thanks for your responses.

It seems that even though I have activeX specified as my default browser it is not selected for additional report windows so I have amended my code in the hyperlink to include the statement "&viewer=actx" to make sure it is selected, see example below;

BEFORE
("window.parent.parent.location='viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID+"'");

AFTER
("window.parent.parent.location='viewrpt.cwr?apstoken="+Server.URLEncode(token)+"&id="+MyInstanceID+"&viewer=actx"+"'");

Thanks.

SiJeffs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top