Friday, February 24, 2012

Help with LinkTarget

I am trying to access the Employee Summary Report in reporting services examples using URL access.

I want to open the sub-reports in this report to be opened in a different window.

Here is the url I am using

http://ReportServer/ReportService2005.asmx/?%2fAdventureWorks Sample Reports%2fEmployee Sales Summary&rs:Command=Render&rc:LinkTarget=_blank

I was assuming that when I click the sub-report it will open in a browser since the LinkTargete is to _blank.

Please let me know why this is not working .

Thanks!!

SqlNew

The LinkTarget device setting is for the links inside the report, e.g. for drilling down. Instead, consider a javascript code:

=void(window.open('http://localhost/ReportServer?/Adventure Works Sample Reports/Employee Sales Summary','_blank', 'location=no,toolbar=no,left=100,top=100,height=600,width=800'))"

|||

Hi,

thanks for the information. I trying to using this asp.net web application where i am building the url dynamically and passing it to a iframe. when i click on the report it opens in the iframe and when i click on the subreport i want subreport to open in a new browser.

thanks

SqlNew

|||

So the main report is loading in an iframe, correct? By subreport I assume you mean a drillthrough report which is displayed after the user clicks on a hyperlink on the main report, correct? If so, the LinkTarget should open up in a new window. Note that your URL link is wrong. It should be:

http://<machinename>/ReportServer?/AdventureWorks Sample Reports/Employee Sales Summary&rs:Command=Render&rc:LinkTarget=_blank

If still no new window, try the javascript approach.

|||

Hello Teo Lachev,

I corrected the URL still i am not able to open the subreport in a new window. I tried setting the src of the iframe with the javascript I get a page cannot be displayed error.

here is the src set to the iframe.

src='javascript:void(window.open('http://<machinename>/ReportServer/ReportService2005.asmx/?%2fAdventureWorks Sample Reports%2fTerritory Sales Drilldown&rs:Command=Render&rc:LinkTarget=_blank','_blank', 'location=no,toolbar=no,left=100,top=100,height=600,width=800'))'

this is set in a method is side the code of asp,net page as follows where GETURL is the method which builds the url.

String ifrDis= "";

ifrDis += "<iframe width=100% height=800px frameborder=0 scrolling=no id='if_displayreport' marginwidth=\"0\" marginheight=\"0\" vspace=\"0\" hspace=\"0\" style=\"overflow=hidden;\" src='http://pics.10026.com/?src= ";

ifrDis += void(window.open('" + GETURL() + "','_blank', 'location=no,toolbar=no,left=100,top=100,height=600,width=800'))' ";

ifrDis += " runat=server/>";

disArea.InnerHtml = ifrDis;

Please let me know if i am missing something.

Thanks!!

SqlNew

|||

Again, the URL is wrong. Should be

http://localhost/ReportServer?/Adventure Works Sample Reports/Employee Sales Summary

Open up IE and make sure that the URL works.

|||

hello,

I think I typed the URL wrong, I am able to open the report from IE but this happens when i set the url for the iframe.

thanks!!

|||I have spent some time trying to figure out what was wrong, and basically it would appear that, if your iFrame has ANY style information (through the style attribute or stylesheet) then IE will NOT obey the LinkTarget.

My solution is place the iFrame within a DIV tag if you need to apply any style information.

It is absolutely shocking that something like this breaks it, but that's the IE we know and love/hate.

No comments:

Post a Comment