首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

在表格中新建窗口打开超链接

2012-07-27 
在报表中新建窗口打开超链接Navigating to other reports or any web URL- Drag a datafield on the repor

在报表中新建窗口打开超链接

Navigating to other reports or any web URL
- Drag a datafield on the report
- Click on the Textbox
- Find the Action property of Textbox the property window
- Select Go to URL option
- Type any valid URL (i.e. http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3668), valid URL must start with protocol like http: ,ftp:, mailto: ...

Opening Link in a new window
Well this is very common requirement but unfortunately there is no direct option available in Reporting Services Designer. You can do that using the following technique
Use the following expression in the "Go to URL"

="javascript:void(window.open('http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3668','_blank'))"

How to overcome expression length limitation (Dynamicly generate hyperlink)
Another limitation of "Go to URL" field is you are limited to Maximum expression characters. You can solve this problem by using "Dummy parameters". You can create parameters for report without any prompt string and then specify default value which will act as a constant for your report.
For example if I have a really long URL which is not allowed in the "Go to URL" expression then I can create a new report parameter called CW_URL. Set your long URL as default value for this parameter. Now remove any prompt string for this parameter so it wont appear when you run your report.
default value for cw_url => http://binaryworld.net/Main/CodeDetail.aspx?CodeId=
Now you can type the following expression in "Go to URL" to get dynamic URL based on Database field called CodeID and static URL from cw_url hidden parameter.

="javascript:void(window.open('" & Parameters!cw_url.Value & Fields!CodeId.value & "','_blank'))"

热点排行