0

How I can control Parameter based on values in another parameter?

I have 3 fields in my report:

Include All Dates
Start date
End Date

If user enter 'No' in Include All Dates parameter then Start date and End Date parameter should be editable otherwise it should be grayed.

My parameters look like this:

Parameters

How can this be achieved?

Chris Latta
  • 20,316
  • 4
  • 62
  • 70
Khushboo
  • 53
  • 1
  • 7

1 Answers1

0

Firstly, I hope you have already checked this

If that doesn't help then please make simple screen and pass parameters to Report it would be great if you do like this way. As Even I had the same problem but I could not make it possible. While passing parameters from that screen, it must be hide from report parameter properties.

Let me know, if you need more help. I will definitely help you in this issue

Community
  • 1
  • 1
Pedram
  • 6,256
  • 10
  • 65
  • 87
  • Yes I tried that but when i follow the steps I created a dataset IncludeData and Try to link My Startdate and end date with the dataset it gives me error that it cannot find the Includedate parameter.I am not sure what mistake I am doing. – Khushboo May 04 '16 at 05:26
  • show me the code I will help you to fix the problem. – Pedram May 04 '16 at 05:27
  • I added a dataset Includedata ,Here I wrote a query IF @Includedate = 'Yes' SELECT NULL AS Date ELSE SELECT cast('1/1/2012' AS datetime) as Date .I try to link it with startdate and enddate default value but it gives me error – Khushboo May 04 '16 at 05:31
  • When I run the report i get an error:The value expression for the query parameter '@includedate refer to an non existing parameter – Khushboo May 04 '16 at 05:38
  • Possibly some parameter casing issue, it must be the same. also please check http://stackoverflow.com/questions/5252588/ssrs-2008-error-message-saying-my-parameter-doesnt-exist-but-it-clearly-does – Pedram May 04 '16 at 05:41
  • It is working now but it is not grayed when I select @IncludeDate ="yes" – Khushboo May 04 '16 at 05:49
  • please change it from `@IncludeDate` ="yes" to `@IncludeDate` =yes - I mean in parameters available values it should be simply Yes - No and in default values it should be No Or Yes. then try – Pedram May 04 '16 at 06:04
  • I did that , now when i preview the report When i Select "Yes" my startdate and enndate get selected as default value and when i select "no" it gives me calender control to choose the date , but when i click to ViewReport button automatically values disappear – Khushboo May 04 '16 at 06:11
  • it can be caching issue, can u pls delete cache and then try. Also I would like to discuss more with you on this topic but as you don't have 25 reputation I cannot discuss so sorry for that – Pedram May 04 '16 at 06:16
  • Every time I select a value and click on view report values disapear and it gives me error,Please enter the value for the parameter.I am running this in VisulaStudio I restarted it again but it no luck. – Khushboo May 04 '16 at 06:21
  • check report parameter properties and go to advanced. tick never refresh to check it starts working or not. – Pedram May 04 '16 at 06:23
  • No I selected option 'never Refresh' but still when I select dates range and click on view report ,value disappear – Khushboo May 04 '16 at 06:26
  • now I need to check whole scenario very carefully. as it is just minor issue but not easily find. – Pedram May 04 '16 at 06:32