Friday, February 24, 2012

Hyperlink to a new window

I have two hyperlink-related questions:
1. How can I generate a URL from within a query or stored procedure such that it appears as a hyperlink within the report? On my first attempt, the text of the link shows but it does not appear as a "live" link within the generated report.
2. Once I've achieved #1, how can I get that link appear in a new browser window rather than the one in which the report is currently displayed?
Thanks in advance for the advice.#1:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
#2: Take a look at _LinkTarget device info setting:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"virtualfergy" <virtualfergy@.discussions.microsoft.com> wrote in message
news:11FD9027-8D50-4DD6-83F9-D9091D3F099A@.microsoft.com...
> I have two hyperlink-related questions:
> 1. How can I generate a URL from within a query or stored procedure such
that it appears as a hyperlink within the report? On my first attempt, the
text of the link shows but it does not appear as a "live" link within the
generated report.
> 2. Once I've achieved #1, how can I get that link appear in a new browser
window rather than the one in which the report is currently displayed?
> Thanks in advance for the advice.
>|||Your links proved unhelpful for the following reasons:
#1 - This link talks about how to add a hyperlink to a report manually. I want to return a URL from a query in a field and have the link appear and be active without having to manually set it up.
#2 - This link indicates how to use the LinkTarget parameter when executing a report to set the device to which the links in the report are directed. But what I'm attempting to do is to have certain links in a report shown in a new window. These links are not drillthrough reports, they're just links to other related subsystems (in this case a problem tracking system).
Example:
If my report gets information from the following query...
select url from urlsource
and urlsource contains
* http://www.site1.com/
* http://www.site2.com/
How could I get the site1 url to show in the same window as the report and site2 to popup a new window? And if the text of these URLs are returned as fields, can I make them active links automatically or do I have to set an action on the field?
"Ravi Mumulla (Microsoft)" wrote:
> #1:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
> #2: Take a look at _LinkTarget device info setting:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "virtualfergy" <virtualfergy@.discussions.microsoft.com> wrote in message
> news:11FD9027-8D50-4DD6-83F9-D9091D3F099A@.microsoft.com...
> > I have two hyperlink-related questions:
> >
> > 1. How can I generate a URL from within a query or stored procedure such
> that it appears as a hyperlink within the report? On my first attempt, the
> text of the link shows but it does not appear as a "live" link within the
> generated report.
> >
> > 2. Once I've achieved #1, how can I get that link appear in a new browser
> window rather than the one in which the report is currently displayed?
> >
> > Thanks in advance for the advice.
> >
>
>|||On the question of treating your field data as a URL, there is the URLEncode command.
=Web.HttpUtility.UrlEncode(Fields!Serial.Value)
(http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?query=URLEncode&dg=microsoft.public.sqlserver.reportingsvcs&cat=&lang=en&cr=US&pt=&catlist=6C839803-6334-48D8-A2C3-72A1BEF0053D&dglist=&ptlist=&exp=
)
There is another thread that can answer some potential issues you may have with implementing this.
(http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?query=URLEncode&dg=microsoft.public.sqlserver.reportingsvcs&cat=&lang=en&cr=US&pt=&catlist=6C839803-6334-48D8-A2C3-72A1BEF0053D&dglist=&ptlist=&exp=)
On your second question, about being able to open a link in a new window...if you are using Report Manager for your distribution platform, then there is NOT a current way to do so. Even if you are using the HTML Viewer and sending in rc: comands, it is an all or nothing deal - either all your links open in a new window or none of them do. I have sugested a few features that I hope MS will implement into one of their future SPs, but until that time, your options are few.
"virtualfergy" wrote:
> Your links proved unhelpful for the following reasons:
> #1 - This link talks about how to add a hyperlink to a report manually. I want to return a URL from a query in a field and have the link appear and be active without having to manually set it up.
> #2 - This link indicates how to use the LinkTarget parameter when executing a report to set the device to which the links in the report are directed. But what I'm attempting to do is to have certain links in a report shown in a new window. These links are not drillthrough reports, they're just links to other related subsystems (in this case a problem tracking system).
> Example:
> If my report gets information from the following query...
> select url from urlsource
> and urlsource contains
> * http://www.site1.com/
> * http://www.site2.com/
> How could I get the site1 url to show in the same window as the report and site2 to popup a new window? And if the text of these URLs are returned as fields, can I make them active links automatically or do I have to set an action on the field?
> "Ravi Mumulla (Microsoft)" wrote:
> > #1:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
> > #2: Take a look at _LinkTarget device info setting:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
> >
> > --
> > Ravi Mumulla (Microsoft)
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> > "virtualfergy" <virtualfergy@.discussions.microsoft.com> wrote in message
> > news:11FD9027-8D50-4DD6-83F9-D9091D3F099A@.microsoft.com...
> > > I have two hyperlink-related questions:
> > >
> > > 1. How can I generate a URL from within a query or stored procedure such
> > that it appears as a hyperlink within the report? On my first attempt, the
> > text of the link shows but it does not appear as a "live" link within the
> > generated report.
> > >
> > > 2. Once I've achieved #1, how can I get that link appear in a new browser
> > window rather than the one in which the report is currently displayed?
> > >
> > > Thanks in advance for the advice.
> > >
> >
> >
> >|||Look at my post from 8/26:
I think I have a solution. If you want a particular link to be opened in a
new window, enter this into the "Jump to URL" field:
javascript:if(window.open(yourPage.aspx','RsWindow','width=400,height=500,location=0,menubar=0,status=0,toolbar=0,scrollbars=1',true)){}
"Rob 'Spike' Stevens" wrote:
> On the question of treating your field data as a URL, there is the URLEncode command.
> =Web.HttpUtility.UrlEncode(Fields!Serial.Value)
> (http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?query=URLEncode&dg=microsoft.public.sqlserver.reportingsvcs&cat=&lang=en&cr=US&pt=&catlist=6C839803-6334-48D8-A2C3-72A1BEF0053D&dglist=&ptlist=&exp=
> )
> There is another thread that can answer some potential issues you may have with implementing this.
> (http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?query=URLEncode&dg=microsoft.public.sqlserver.reportingsvcs&cat=&lang=en&cr=US&pt=&catlist=6C839803-6334-48D8-A2C3-72A1BEF0053D&dglist=&ptlist=&exp=)
> On your second question, about being able to open a link in a new window...if you are using Report Manager for your distribution platform, then there is NOT a current way to do so. Even if you are using the HTML Viewer and sending in rc: comands, it is an all or nothing deal - either all your links open in a new window or none of them do. I have sugested a few features that I hope MS will implement into one of their future SPs, but until that time, your options are few.
> "virtualfergy" wrote:
> > Your links proved unhelpful for the following reasons:
> >
> > #1 - This link talks about how to add a hyperlink to a report manually. I want to return a URL from a query in a field and have the link appear and be active without having to manually set it up.
> >
> > #2 - This link indicates how to use the LinkTarget parameter when executing a report to set the device to which the links in the report are directed. But what I'm attempting to do is to have certain links in a report shown in a new window. These links are not drillthrough reports, they're just links to other related subsystems (in this case a problem tracking system).
> >
> > Example:
> >
> > If my report gets information from the following query...
> >
> > select url from urlsource
> >
> > and urlsource contains
> >
> > * http://www.site1.com/
> > * http://www.site2.com/
> >
> > How could I get the site1 url to show in the same window as the report and site2 to popup a new window? And if the text of these URLs are returned as fields, can I make them active links automatically or do I have to set an action on the field?
> >
> > "Ravi Mumulla (Microsoft)" wrote:
> >
> > > #1:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
> > > #2: Take a look at _LinkTarget device info setting:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
> > >
> > > --
> > > Ravi Mumulla (Microsoft)
> > > SQL Server Reporting Services
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > > "virtualfergy" <virtualfergy@.discussions.microsoft.com> wrote in message
> > > news:11FD9027-8D50-4DD6-83F9-D9091D3F099A@.microsoft.com...
> > > > I have two hyperlink-related questions:
> > > >
> > > > 1. How can I generate a URL from within a query or stored procedure such
> > > that it appears as a hyperlink within the report? On my first attempt, the
> > > text of the link shows but it does not appear as a "live" link within the
> > > generated report.
> > > >
> > > > 2. Once I've achieved #1, how can I get that link appear in a new browser
> > > window rather than the one in which the report is currently displayed?
> > > >
> > > > Thanks in advance for the advice.
> > > >
> > >
> > >
> > >

No comments:

Post a Comment