问题
I have a problem with hyperlinks in my rdlc report. I configured a tablix's textbox by applying steps in this tutorial.(It seems very easy though)
It seems to hyperlinks are not working in the reportviewer control (I mean when I look to report in browser) but when I export that report to PDF all these links works as shine.
I tried setting enableHyperlinks option to true. I tried in different browsers.
Any comment on where could I be wrong is appriciated.
回答1:
I'm not sure if this relates to your specific problem or not, but I have recently discovered that if you set the action to URL, it must be a full URL, and not a relative one.
For instance, if you are setting the URL as
="MyPage.aspx?myprop=" & Fields!SomeProp.Value
The result will be that no hyperlink is actually added to the field.
However if you had something like
="http://localhost/MyPage.aspx?myprop=" & Fields!SomeProp.Value
it should work just fine, because that is a full URL
This, of course, brings up the problem of not knowing where the application is. For instance, if you set this to localhost and then put this on the production server it would probably fail for most people.
In order to handle that scenario, you will need to add a parameter to pass in the base URL from the web page and then add the rest.
= String.Format( _
"{0}/MyPage.aspx?myprop={1}", _
Parameters!BaseUrl.Value, _
Fields!SomeProp.Value _
)
回答2:
This works fine for me:
I just add a new parameter in my rdlc as @BaseUrl and Use the same index in TextBox Properties > Action > Go To Url and
String.Format("{0}Pages/PageName.aspx?item{1}",Parameters!BaseUrl.Value,Fields!YourField.Value)
and set Perameter as http://localhost:1268/
or ur url...
来源:https://stackoverflow.com/questions/7997822/rdlc-report-hyperlink-are-not-working-in-browser