开发者

SSRS how to show only month/year as a parameter using/customizing calendar control

开发者 https://www.devze.com 2023-04-03 21:39 出处:网络
I use SSRS 2005.I currently have two datetime parameters (for start and end dates) as parameters for my report. I get the default calendar controls to select the dates.

I use SSRS 2005.I currently have two datetime parameters (for start and end dates) as parameters for my report. I get the default calendar controls to select the dates.

I want to show only month and year in the calendar control which can be selected by user. Is that possible?

I can create two text fields and let user enter month & year in each text field and i've two validate these two text fields. I dont want to do this because needs typing into the fields.

OR

I can create four dropdown lists for start month, start year and end month and end year with values but this involves cl开发者_开发知识库icking/scrolling a bit more. Dont want to do this either.

Can somebody suggest a solution?

Thank you Bo


This cannot be done using the calendar control.

You can either use the calendar control ignoring the day or implement one of the other two solutions you mentioned.

In case of combobox, you can use select distinct month/year from your data to fill values.

To make this less annoying for your user's to run the report, default your month/year from/to values to these that usually the user selects to run the report.

Personally I would prefer textboxes with default values

eg. If user runs the report for current year from January to current month then the defaults would be

Month from: = 1
Month to: = Datepart("m", Now())
Year from, Year to: = Datepart("yyyy", Now())
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号