开发者

Textbox in Reporting Services - show text or hyperlink

I have a report in SQL Server Reporting Services which should show

  • a text开发者_高级运维 box with a static text for "normal" users
  • a text box with a hyperlink to open up a new details windows for "super" users

The user level is determined by a parameter being passed into the report.

How can I achieve this? I tried to create a textbox with a text span inside that has a hyperlink, and then just leave it blank for "normal" users, but that doesn't seem to work reliably.

Is there a trick or method to get this to work? I'm thinking I need to add some code to the report to check the user level and then either insert a static text, or a text with a label, into that target textbox. But how do I do that (not having any VB/VBA/VB.NET experience....)

Thanks! Marc


To make the hyperlink, you should be able to use an expression like

=iif(Parameters!IsSuperUser.Value = True, "http://some link","#")

in the Action property of the textbox, if you set the Action to "Jump to URL".

To control the content of the textbox, use a similar expression in the Value property.

(This is true on SSRS 2005 - I don't have access to 2008)

Edit

Unfortunately, hyperlinks in SSRS aren't formatted in a way to make it clear that they're hyperlinks. The only way to achieve this would be to add similar conditional formatting expression to the Color and TextDecoration attributes to make the field appear in a different colour and underlined when it is a hyperlink.


I haven't got SSRS installed on the machine that i'm writing this on so i can't give you an exact guaranteed bug free answer, but this answer should set you on the right track.

Have two textboxes, both located in the same absolute position (inside a container element if necessary). Fill them both with their correct values. Then just control their visibility by toggling their Hidden property with an expression:

=(Parameters!UserLevel.Value = 'Admin')

Obviously UserLevel is the name of the parameter being passed in to the report. The 'Admin' value is for illustrative purposes, personally i would use an int value to represent the user level, much like using an enum.

Remember that it is the Hidden property you are setting, so you have to reverse the logic you would have used if you were setting a Visible property :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜