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
Jamiehttp://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
November 14th, 2010 12:08pm
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.
Gaurav Gupta http://sqlservermsbiblog.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 14th, 2010 5:04pm
Ah another good idea Guarav. Thank you.http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
November 14th, 2010 5:11pm
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-expressionhttp://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 7:41am
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! ;)
Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
November 26th, 2010 8:22am
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?
Thanks for the comments on the UG. Always nice to hear stuff like that, believe me.
@Jamiet
http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 9:28am
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 :( )Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
November 26th, 2010 9:48am
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
http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 10:00am
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.Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
November 26th, 2010 10:11am
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!!!
Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 10:16am
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.
@jamiet
http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
November 26th, 2010 10:18am
In this case, let me remove my comments from the connect page also that you posted.
P.S. Comments can't be removed :(http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 10:20am
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!!!Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
November 26th, 2010 10:33am
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 :)http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 10:37am