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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Hyperlinks - How to open in new window

Status
Not open for further replies.

radavis

MIS
Sep 29, 2004
4
GB
I have a report which contains hyperlinks to other reports within ePortfolio (Crystal 10, Enterprise 10). However, when you click on the hyperlink the new report overwrites the current report in the same browser window.
It would be good if you could configure the link so that the linked report always opens in a separate browser window. I know you can right click and use the 'open in new window' option but I don't see why this can't be configured just by clicking on the link.
I have looked through CE 10 docs for any configuration option that might be available but there doesn't appear to be one.
I have also tried disabling the 'Reuse windows for launching shortcuts' option in IE but all to no avail.
I can't believe that this isn't an option when you configure the hyperlink in the report.

Anyone got any ideas?? This seems so basic it must surely be possible?

Thanks
Roger Davis
 
In user crystal reports preferences there is a setting
"display my reports" where you can pick:
in a single browser window, one report at a time.
in multiple browser windows, one window for each report.

I am not sure if it can only be set one user at a time or if it would even affect the hyperlink situation. Have you tried this?
 
It sounds like you're using the DHTML Viewer in Crystal.

Not sure why you wouldn't share such important, basic info in your post.

If so, then you are using a BROWSER to view the reports, and the settings are controlled by your BROWSER, not Crystal.

You might write code to change how CE is building the links to create a new window.

-k
 
Thanks for responses:

pelajhia - I've tried setting to multiple browser windows but has no effect, thnks anyway.

synapsevampire = yeh its the DHTML viewer. Could you point me to specific files I would need to look at modifying to customise how links are built within CE?

 
I am in the same problem. On clicking a report hyperlink it takes me to the page viewrpt.csp from where it is redirected to viewrpt_viewer.csp. In this last csp page "ProcessHttpRequest" is used to open the report in second stage.

My question is does ProcessHttpRequest method always opens the viewer in same window. I also tried setting the viewer's HyperLinkTarget property to "blank" with no result.

How can I open a hyperlink in a new window??

Any help?

Aurobindo

Here's two pages for your reference
================
VIEWRPT2.CSP
=================
<%@ language=JavaScript codepage=65001%>
<!-- #include file="helper_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<!-- #include file="setcodepage.csp" -->
<!-- #include file="helper_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<!-- #include file="handleerror_js.csp" -->


<%
var Viewer;
var strRedirect;
var GF;
Response.Expires=1;

var iStore = CheckSession(true);


switch(GetSubCookie("eportfolio_prefs","vwr"))
{
case 0:
Viewer = "actx";
break;
case 1:
Viewer = "html_frame";
break;
case 2:
Viewer = "html_page";
break;
case 3:
Viewer = "java";
break;
case 4:
Viewer = "java_plugin"
break;
case 5:
Viewer = "nav_plugin";
break;
default:
Viewer = "html_frame"
break;
}

GF=Request.QueryString.Item('gf');



EnsureImageCleanerIsRunning();
viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer" );

viewer1.HyperlinkTarget = "_self";//Auro



var rptSrcFactory = iStore.EnterpriseSession.Service ("", "RASReportFactory");

var oReportClientDoc = rptSrcFactory.OpenDocument(Number(GetSession("RptSrcID")));



var ObjFactory = Server.CreateObject("CrystalReports.ObjectFactory");


var oFilter = ObjFactory.CreateObject("CrystalReports.Filter");


if (String(GF)!="undefined")
{
oFilter.FreeEditingText = GF;

oReportClientDoc.DataDefController.GroupFilterController.Modify(oFilter);



}



Session.Value("oReportClientDoc") = oReportClientDoc;

Session.Value("viewer2") = viewer1;//Auro - Stored the viewer object in Session named viewer2


Response.Redirect("viewrpt2_viewer.csp?gf="+GF);


%>


================
VIEWRPT2_VIEWER.CSP
=================
<%@ language=JavaScript codepage=65001%>
<!-- #include file="helper_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<!-- #include file="setcodepage.csp" -->
<!-- #include file="helper_js.csp" -->
<!-- #include file="checksession_js.csp" -->
<!-- #include file="handleerror_js.csp" -->


<%
var Viewer;
var strRedirect;
var GF;
Response.Expires=1;

var iStore = CheckSession(true);

//Adding code for removing the caching problem Incedence #: 2026097

Response.Expires = 0;

Response.Expiresabsolute = -1;

Response.AddHeader("pragma","no-cache");

Response.AddHeader("cache-control", "private");

Response.CacheControl = "no-cache";

//End of addition for caching problem


GF=Request.QueryString.Item('gf');



EnsureImageCleanerIsRunning();
// viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer" );//Auro comment
viewer1 = Session.Value("viewer2");

Response.Write(viewer1.HyperlinkTarget);
//Response.End();






//Determine whether to open in new window or not Report B (false) new window, Report A (true) same window



//Response.Write("Total Number of Groups " + String(Session.Value("oReportClientDoc").DataDefController.DataDefinition.Groups.Count));


//viewinfo1 = Server.CreateObject( "CrystalReports.CrystalReportViewInfo" );

//Response.Write("<BR>" + "Current GroupLevels " + String(viewinfo1.GroupLevel));
//Response.Write("<BR>" + "Current GroupName " + String(viewinfo1.GroupName));
//Response.Write("<BR>" + "Current GroupNamePath " + String(viewinfo1.GroupNamePath));
//Response.Write("<BR>" + "Current GroupPath " + String(viewinfo1.GroupPath));

//Response.End();


//if (Session.Value("WindowType") == 'True')
//{
// viewer1.HyperlinkTarget = "_self";
//Response.Write(viewer1.HyperlinkTarget)
//Response.End();
//}
//else
//{
// viewer1.HyperlinkTarget = "_blank";
//Response.Write(viewer1.HyperlinkTarget)
//Response.End();

//}
//End of determining the window type
















viewer1.ReportSource = Session.Value("oReportClientDoc").ReportSource;

if(String(GF)!="undefined")
{
viewer1.ViewTimeSelectionFormula=GF;
viewer1.SelectionFormula=GF;
viewer1.URI="viewrpt2_viewer.csp?gf="+GF;
}
viewer1.IsOwnForm = true;
viewer1.IsOwnPage = true;
viewer1.IsDisplayGroupTree = false;
viewer1.PageToTreeRatio = 5.0;
viewer1.IsDisplayToolbar = true;
viewer1.IsDisplayPage = true;
viewer1.HasRefreshButton = true;

viewer1.ParameterFields = Session.Value("Parameters"); //Added on 21 sept 04 for ondemand report input screen

//viewer1.ProcessHttpRequest(Request, Response, Session );

%>
 
I've done this by using javascript to open the new window and the viewer.GetHTMLContent as this allows you to modify the code used in the viewer. Stage 1 is setting the hyperlink in the crystal report to be pseudo code that will be replaced in the viewer page:

"onclickjavascript:window.open("
followed by the report path and params.

Within the viewer code :

reportView = viewer1.GetHTMLContent( Request, Response, Session )

reportView = replace(reportView,"href=" & chr(34) & "onclickjavascript", "onclick=" & chr(34) & "javascript")

The down side with this is that some functionality of the viewer isn't available when using GetHTMLContent so i've had to code that back in as well.
 
Hi huggyd,
Thanks for your tips. Sorry I am not a expert in ASP or CSP. So I need your assistance in details for these. Can you provide my e mail address so that I can sent the files over mail. Or if we can talk to look for a solution.

One thing that business objects team told me GetHTMLContent will remove the bottons like Export and Print from the top menu bar. That's bad. But they said you can recreate them once you open that in new window. No details how.

Can you explain how the whole thing work? A tele conversation may me most helpful 303 624 3066

Thanks

AS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top