Enable / Disable Hyperlink Action of TextBox Based on Value

  • I have a textbox on a matrix report that references a field in my datasource. As you know, in a matrix, there is not always a value in the textbox. When there is a value, I want the hyperlink action to be enabled, if there is not a value I want to disable the hyperlink action so that the user doesn't click to a report that has no data.

    How can I set this property based on value?

  • What I have done in the past in similar situations is to place a rectangle in the matrix instead of a textbox. Then, in the rectangle, place 2 textboxes with your value. On one of these set the hyperlink value, then set the visibility on both the textboxes such that one is hidden and the other visible depending upon the value in question.

  • Is it not possible by adding a "=IF(NOT(MyFields.Value Is Null);'http://xxxxx';'')" If the field is not null, the Action will be set to the url otherwise to an empty string.

    (remark : i've not checked my syntax)

    Christophe

  • I've tried that, and while it is true that you would not send the user anywhere, you would still have the cursor change from an arow to hand (or whatever your mouse is set for URL links) when they hover over that field.

  • Oh! I was not aware of this. Thanks for the info.

    Christophe

  • I solved this in an acceptable, but probably not most optimal way. I just set the Jump to Report value to IIF(Fields!Status.Value IS NOTHING, "SUMMARY REPORT","DETAIL REPORT"). In my example, SUMMARY REPORT is the main report that has the links I am using to link to DETAIL REPORT. If the Status field is empty the user is just directed to the SUMMARY REPORT they were currently viewing. Otherwise, they are directed to the DETAIL REPORT.

  • I think the only shortfall to my solution is that now I don't know how I can pass the parameters. The inline IF is providing the report name which to jump to, but not sure how to pass the parameter value I originally had setup to the detail report.

    Basically, if I am redirecting the user back to the Summary report, the summary does not have parameters assigned so I need to eliminate the passing of the parameter. Otherwise, the Summary report will have an error since it is receiving a parameter from itself. If I am directing the user to the detail when the status is not null, a parameter should be passed.

  • I would venture to suggest once again my strategy for using 2 separate text boxes that contain the same value, one with the action defined to jump to report (along with the parameter designations), and the other with no action defined. Instead of using your IF logic to determine which report to jump to, use it to set the visibility of the 2 textboxes. Have the textboxes overlay each other, so that the rectangle that contains them does not need to be artificially enlarged beyond what the value of either text box is.

    The result of implementing this is that when you have the condition for which you would want to jump to the detailed report, you have the field visible (and thus able to be clicked upon) that will navigate you to that report, and when the condition does not exist, the field that is visible has no defined action on it, thus not confusing users with what they think is a navigation point to something else.

  • I see that TKD-BB's suggestion is a sound one.

    But, if you want to go with your way, have you tried adding a parameter to the Summary report?

    You can define a parameter even if it is not used in the report.

  • TKD-BB (1/21/2009)


    What I have done in the past in similar situations is to place a rectangle in the matrix instead of a textbox. Then, in the rectangle, place 2 textboxes with your value. On one of these set the hyperlink value, then set the visibility on both the textboxes such that one is hidden and the other visible depending upon the value in question.

    I have just done exactly this. THank you for the suggestions.

    I was lucky to have only two places (two textboxes) to fix, but it already looks very dodgy.

    Has anything been done about this in 2008?

    Empty Report Name = no link, or an expression for this feature?

    VALEK

    M.Sc.IT, M.B.A, MCTS BI 2008, MCITP BI 2008, MCTS SQL Dev, CSM, CDVDM

  • kabolick (1/20/2009)


    When there is a value, I want the hyperlink action to be enabled, if there is not a value I want to disable the hyperlink action so that the user doesn't click to a report that has no data.

    Using the following construct as an expression in Jump To Report works for me:

    =IIF(Sum(Fields!CellValue.Value) Is Nothing,Nothing,"Detail Report")

    This way the hyperlink cursor never shows on mouseover for a blank cell; it has the effect of disabling any Action.

  • Nate Neufeld (5/19/2009)


    kabolick (1/20/2009)


    When there is a value, I want the hyperlink action to be enabled, if there is not a value I want to disable the hyperlink action so that the user doesn't click to a report that has no data.

    Using the following construct as an expression in Jump To Report works for me:

    =IIF(Sum(Fields!CellValue.Value) Is Nothing,Nothing,"Detail Report")

    This way the hyperlink cursor never shows on mouseover for a blank cell; it has the effect of disabling any Action.

    I was just about to whinge about that RS does not have this feature. NOTHING is what will save you...

    Thanks for the tip. The trick with the hiding unhiding overlapping cells, as someoe suggested, brought me troubles in the end with export to PDF/EXCEL. It won't render the same as into HTML, which made me remove the feature. I almost said to the customers that it is not possible to remove 'empty click', before I saw your post. I will try it tomorrow and we will see if it works.

    Thanks anyways.

    VAL

    M.Sc.IT, M.B.A, MCTS BI 2008, MCITP BI 2008, MCTS SQL Dev, CSM, CDVDM

  • TKD-BB: Thanks, I had the same question and your two-textboxes method solved it nicely!

    Edit: Then I noticed page two of this thread, saw the problem with Excel export and changed it to

    =IIF(Fields!ResourceType.Value) "Mobile Resource",Nothing,"Mobile Resource Cost Summary")

    😀

    Thanks all!

  • hi.

    there is a simple solution for your problem, just use an IIF and a "false" value, just like the next example i used for my report for disabling the hyperlink.

    =iif(Fields!UpTo24H_Count.Value<>0,"desired_report", false)

    "desired_report" is the name of the report you want to go to using the hyperlink, you

    can use this example for a lot of things, i used it to disable the tooltip i added to the hyperlink,

    and the same for the underlined property i added to the text in the font properties.

    good day.

    gil eiliya

  • I solved this by using the following expression

    =IIF(Cint(Fields!Field1.Value) > 0,"ReportName/URL",nothing)

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic. Login to reply