简体   繁体   中英

SSRS optional cascading parameter for date

I have a report that I am attempting to setup a subscription for. The subscriber would like the report on the 4th every month for the previous month's end date. eg ran today would return the data through 10/31.

I would like to create this report so that there is a cascading parameter that would be labeled Use previous month end date to set the end date to the subscription date when flagged on and allow the user to enter a date when flagged off. so that i can use this parameter to create the dynamic subscription but allow anyone else hitting it through the report server to enter their own date.

Is this possible?

You don't need the UsePriorMonth parameter - just default the date range to be the prior month and allow users to change it if they want.

So your DateFrom parameter Default Value expression is:

=DateAdd(DateInterval.Month, -1, DateAdd(DateInterval.Day, 1-Day(Today), Today))

and your DateTo parameter Default Value expression is:

=DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Day, 1-Day(Today), Today))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM