Conditionally turn on an action

Hi,

I want use an action to launch another report when clicking on a textbox however I only want to do it under certain circumstances. Strangely I don't see an option to put an expression on the "Action" property. Why is this?

Is there any other way to conditionally set the Action?

thanks
Jamie

November 14th, 2010 5:05pm

Sir,

i dont think there are any property to directly help in this,

Work around can be

To have two text box, one will have action property enable one will have disable.

and based  on you condition you can hide one and show one. 

Free Windows Admin Tool Kit Click here and download it now
November 14th, 2010 10:03pm

Ah another good idea Guarav. Thank you.
November 14th, 2010 10:10pm

Submitted a Connect request for this here: https://connect.microsoft.com/SQLServer/feedback/details/624903/ssrs-give-us-ability-to-set-an-action-using-an-expression
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 12:40pm

On the contrary, I feel this is very much possible, if my understanding is correct. I just replicated it using the steps below -

1) Made a simple report with a datetime report parameter. Made one text box and the value is set as the expression given below

=iif(instr(Parameters!Report_Date.Value,"19")>0,"http://bing.com","")

2) The same expression is given to the Jump to URL property in the navigation tab of textbox

3) Now preview the report. When you select a date like 19/10/2010, and then click on the textbox, the site bing.com will open up. But if a date which doesnt contain 19 is selected, then basically you will not be able to have the click option.

 

The expression can be substituted for whatever you want, and the url can be substituted for the report url

By the way, great session for the London SQL User Group meeting, found it pretty nice listening to you and Chris speaking on the new features of Denali. Thanks! And yeah, the rounded edges in SSIS look sexy! ;)

November 26th, 2010 1:22pm

Jason,

Unfortunately that doesn't work for me. here's what I did:

1. New report
2. new boolean parameter called TF
3. New text box that has:

 

  • Arbitrary text value being displayed
  • Action="Go to report"
  • expression on the 'Specify a report' of '=IIF(Parameters!tf.Value = true,"SomeOtherReport","")'

 

When the parameter is "true" everything works. When the parameter is "false" the textbox is still "hyperlinked" (if that makes sense) but when I click it I just get an error: "Report / cannot be compiled". Which makes total sense if you think about it. I want the textbox to simply not have be hyperlinked.

Any other thoughts?

Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 2:27pm

Hi Jamie,

I am not sure which version you are using buit it works for me in SSRS 2005. The image is given below

I think I got the issue, you should be entering the condition in Specify a URL and not specify a report. And you should not just pass the report name like SomeOtherReport but the full URL which you get when you deploy it on the web, something like

http://<servername>/ReportServer/SomeOtherReport&rs:Command=Render

Let me know if you dont get it still with the SSRS version too (it worked for me till R2 and I can test it at my home laptop till R2, not into Denali yet :( )

November 26th, 2010 2:47pm

Hi Jamie,

I am not sure which version you are using buit it works for me in SSRS 2005. The image is given below

I think I got the issue, you should be entering the condition in Specify a URL and not specify a report. And you should not just pass the report name like SomeOtherReport but the full URL which you get when you deploy it on the web, something like

http://<servername>/ReportServer/SomeOtherReport&rs:Command=Render

Let me know if you dont get it still with the SSRS version too (it worked for me till R2 and I can test it at my home laptop till R2, not into Denali yet :( )

 

Hi Jason,

I'm on SSRS2008.

I accept that it works for "Specify a URL" but I want it to work for "Specify a report". Hacking together a URL that includes the name of the report server is a right royal PITA and in actual fact won't work for me anyway because I'm intending these reports to be displayed via SSMS - i.e. without a reportserver being involved.  (FYI: Coincidentally, given that you mentioned it, the reports I am working on are the ones I demo'd at the end of my UG session last week).

Resigning myself to this not working :(

@Jamiet

 

Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 2:59pm

I should have guessed that you were trying on SSMS especially after seeing your other open thread also - Why no parameters when a report is rendered in SSMS?

Well, in this case, I dont think you have much option (well, you can always pass the name of the same report as the false condition, which will make sure that the user will go to the next report only if the condition is true, else stays on the same report. But I admit, it will be very annoying and irritating to the user to see something refresh and find himself on the same page).

In this case, let me remove my comments from the connect page also that you posted.

November 26th, 2010 3:10pm

Hi Jamie,

I was just trying and I seem to have found something. Use the condn below and see whether it works for u

  • expression on the 'Specify a report' of =IIF(Parameters!tf.Value = true,"SomeOtherReport",0)

    Just put a 0 and it worked for me!!!

  • Free Windows Admin Tool Kit Click here and download it now
    November 26th, 2010 3:15pm

    you can always pass the name of the same report as the false condition, which will make sure that the user will go to the next report only if the condition is true, else stays on the same report. But I admit, it will be very annoying and irritating to the user to see something refresh and find himself on the same page

    Hey, I never thought of that. Right now that seems like my best option.Thanks Jason.

    As an aside, Guarav's tip above works for stand-alone textboxes but not when the textbox is in a datagrid. What I'm doing currently in that case is using a visual cue (i.e. underlining) to indicate whether a textbox is "clickable" or not. Yes, all of the cells are clickable (because of the limitations we've talked about), but only the ones that click to something useful have the underline. Better than nothing.

     

    @

    November 26th, 2010 3:17pm

    In this case, let me remove my comments from the connect page also that you posted.

     

    P.S. Comments can't be removed :(
    Free Windows Admin Tool Kit Click here and download it now
    November 26th, 2010 3:18pm

    Hi Jamie,

    Just reposting in case you missed the alerts

    I was just trying and I seem to have found something. Use the condn below and see whether it works for u

     

    expression on the 'Specify a report' of =IIF(Parameters!tf.Value = true,"SomeOtherReport",0)

    Just put a 0 and it worked for me!!!

    November 26th, 2010 3:30pm

    Hi Jamie,

    Just reposting in case you missed the alerts

    I was just trying and I seem to have found something. Use the condn below and see whether it works for u

     

    expression on the 'Specify a report' of =IIF(Parameters!tf.Value = true,"SomeOtherReport",0)

    Just put a 0 and it worked for me!!!

    Blimey, that does work. Awesome. Thanks Jason.

     

    I still say there should be an expression on the Action property though :)

    Free Windows Admin Tool Kit Click here and download it now
    November 26th, 2010 3:34pm

    This Works! Thanks!
    July 28th, 2015 12:27am

    This topic is archived. No further replies will be accepted.

    Other recent topics Other recent topics