Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

sql - SSRS Grey out Parameter based on result from other Parameter

I wondered if it was possible to grey out a parameter based on the the result from another parameter? In this case, if specify date is set to 'No' then Start Date and End Date should be greyed out.

SSRS

As you can see from the screenshot this hasn't happened, despite setting Specify Date to either Yes or No - start date and end date will expect a value (unless you tick the NULL value). The report will run fine if both the NULL boxes are ticked beside both the start and end dates - but if they are automatically greyed out based on 'No' it will make the process a lot easier for users.

So in short, if 'No' dates greyed out, if 'Yes' display. Is this possible? and if so how?

Many thanks in advance for any replies

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Within the confines of what's built-in, you can use this method:

  1. Create a dataset that is based on your SpecifyDate parameter.

    if @SpecifyDates = 'No' select null as Date else select cast('1/1/2012' as datetime) as Date

  2. Set the default values for your dates to be based on this dataset.

enter image description here

When you choose "No" for specify dates, the dates will be set to Null, greyed out, and not required to run the report. When you select "Yes" it will put in the default date that you set in the query. Of course you can customize that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...