reporting services - subscription contains parameter values that are not valid -
i have report begin date , end date parameters , meant subscription should serve 2 types of subscriptions: 1, one previous fiscal week -->begin date first day of previous fiscal week , end date last day of previous fiscal week. 2, one previous day -->begin date previous day , end date previous day.
dataset datefields: dataset query results both date parameters available , default values. when create subscription previous day runs day...after midnight day, begin date , end date parameter values blank , subscription fails status message "the subscription contains parameter values not valid" values. subscription created previous fiscal week week until values previous fiscal week start , end dates change.
you using dataset defaults , values date parameters, isn’t best approach.
the way have handled reports want allow end users subscribe to, , have default date values vary depending on whether subscription daily, weekly, or monthly one, have parameter makes possible.
the parameter add report 1 call period (or report period), , has first parameter in report, or @ least listed before date parameters. values in dropdown parameter daily, weekly, , monthly (if applicable). these can whatever need. enter these manually value options in parameter in report, since not expected change often. based on end user chooses parameter when creating subscription, default date values change. done via expression in default value date parameters evaluates value chosen period dropdown.
so, if end user wants daily subscription, choose daily period parameter dropdown, , default values start , end date parameters change include prior day. if choose weekly, start , end date parameters change include prior week, , on.
here example start date parameter default value expression.
=switch(parameters!period.value = "daily" , dateadd(dateinterval.day, -1, today), parameters!period.value = "weekly" , dateadd(dateinterval.weekofyear, -1, dateadd(dateinterval.day, -(datepart(dateinterval.weekday, today, 0, 0)-1), today)) , parameters!period.value = "monthly" , dateadd(dateinterval.month, -1, dateadd(dateinterval.day, -(datepart(dateinterval.day, today, 0, 0)-1), today)))
for end date parameter…
=switch(parameters!period.value = "daily" , today, parameters!period.value = "weekly" , dateadd(dateinterval.day, -(datepart(dateinterval.weekday, today, 0, 0)), today) , parameters!period.value = "monthly" , dateadd(dateinterval.day, -(datepart(dateinterval.day, today, 0, 0)), today))
warning!! changing period value either in report designer (preview), or online, not cause date values automatically change right before eyes. while creating (and executing) subscription, however. have never looked why is. have other, less painful, things fill time.
give try.