惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
F
Full Disclosure
C
Check Point Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
博客园 - Franky
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
博客园 - 司徒正美
博客园_首页
云风的 BLOG
云风的 BLOG
L
LINUX DO - 最新话题
Jina AI
Jina AI
Latest news
Latest news
L
LINUX DO - 热门话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
T
Tenable Blog
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
S
Securelist
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
J
Java Code Geeks
T
Threatpost
The Register - Security
The Register - Security
G
Google Developers Blog
Know Your Adversary
Know Your Adversary
T
Tailwind CSS Blog

博客园 - bela liu

生成PDF文档,并在PDF文档结尾加印章 EF CodeFirst 学习 1 - 用fluent API设置元数据, silverlight: 关于dataform的commit silverlight:datagrid滚动 win7下chm打不开 MS DTC 无法正确处理DC升级/降级事件。MS DTC 将继续运行并使用现有的安全设置。 远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可。 windows server 2008 安装live mail windows server 2008 安装 MSN Help: DCOM中设定"launch permission"的问题 Qt 学习(1) 使用firefox的一个小技巧 - bela liu - 博客园 现有一车(千里马)过年从苏州回赣榆,15号或者17号出发,21号,23号或者25号返程。 在Oracle中申明与某个字段类型相同的变量 几道Python的习题 未解之Bug (1) : 必须放在具有 runat=server 的窗体标记内 在window.showModelessDialog打开的窗体中调用原窗体的alert会使IE死掉。 [转]面向对象与数据模型 在模式窗体中提交而不打开新窗体
在ReportViewer中使用超链接(HyperLink)
bela liu · 2006-10-11 · via 博客园 - bela liu

今天,需要在ReportViewer报表上链接到别一个页面上。
于是给TextBox加上一个Action,并在Action内指定HyperLink,
结果发现,如果指定给HyperLink的不是绝对URL,它就不起作用。
但开发的时候不可能就指出绝对的URL。

而要取得客户端访问的绝对的URL也不是一样容易的事:-),

经过测试,发现只有Request.Url提供此信息。
于是可以采用下方法来指定绝对URL。
1. 在Report上增加报表参数Current_Virtual_Path。

2. 写ReportViewer的Load事件:代码如下:

 1         string req_url = this.Request.Url.ToString();
 2 
 3         int pos = req_url.LastIndexOf('/');
 4 
 5         if (pos > 0)
 6         {
 7             string current_virtual_path = req_url.Substring(0, pos + 1);
 8             ReportViewer1.LocalReport.SetParameters(new ReportParameter[] {
 9             new ReportParameter("current_virtual_path", current_virtual_path) });
10         }

也就是在报表Load的时候把该URL的目录信息作为报表参数传递给Reportviewer。

3. 指定HyperLink的标签的内容为:

=Parameters!current_virtual_path.Value + "文件.aspx"

4. 修改ReportViewer.LocalReport.EnableHyperLinks 为true。

至此搞定。