如何在 rdlc 中为本地主机和服务器设置超链接?
我正在使用 rdlc 报告来显示报告,在 rdlc 报告中,我为另一个报告设置了超链接,例如:
="http://localhost:8080/ReportForms/RECRptAdvertisement.aspx?
reqid="&Fields!RequirementID.Value
从上面的 URL 我的超链接在本地主机中工作正常,但如果我将其更改为:
="~/RECRptAdvertisement.aspx?reqid="&Fields!RequirementID.Value
它不起作用。那么如何设置我的超链接 URL 才能在本地主机和服务器中使用。
I am using rdlc reporting to display report, in rdlc report I was set hyperlink for another report like:
="http://localhost:8080/ReportForms/RECRptAdvertisement.aspx?
reqid="&Fields!RequirementID.Value
From above URL my hyperlink working fine in localhost but if I change it to this:
="~/RECRptAdvertisement.aspx?reqid="&Fields!RequirementID.Value
It is not working. So how do I set my hyperlink url to be workable in localhost as well as in server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将服务器 URL 作为参数传递到报表,然后文本框的表达式应引用该本地报表参数。
向您的报表添加一个新参数并将其设置为
=Parameters!ReportParameterUrl.Value
加载 ReportViewer 时,设置正确的 url:
最后,您的文本框表达式应该是
You need to pass the Server Url to the report as a Parameter, then your expression for the textbox should reference that local report parameter.
Add a new Parameter to your report and set it to
=Parameters!ReportParameterUrl.Value
When Loading the ReportViewer, set the correct url:
Finally, your text box expressions should be
您是否尝试过手动将值传递给 URL 以查看它在本地主机 URL 和命名实例上的行为是否相同?也可以尝试通过IP 怎么样?
像...
Have you tried to pass a value to the URL manually to see if it behaves the sameway on localhost URL and named instance? what about trying via IP as well?
something like...