Sunday, March 25, 2012

Data Driven Subscriptions-Expressions in Parameters

I'm trying to create a report that, when generated, puts in a start
date of last Sunday to last Saturday. To be more specific, take this
week which begins on Sunday, Feb 10 and ends Saturday, Feb 16. When
this report gets generated anytime this week, the start date should be
Sunday Feb 3 and the end date should be Saturday Feb 9. When the
report is run next week, the start date/end date for that report
should be Feb 10/Feb 16.
I figured out the date expression for the start and end dates and set
them as the default for this report in Visual Studio. However, when I
upload them to my Report Server and set the data driven subscription
(DDS) to use the default for those date parameters, it won't let me.
So my question is, in the DDS itself, can I use an expression for the
date paramenters? If the answer is no, then I'm obviously not getting
the syntax correctly.
Any help would be greatly appreicated.On Feb 12, 4:49=A0pm, lsantos13 <lsanto...@.gmail.com> wrote:
> I'm trying to create a report that, when generated, puts in a start
> date of last Sunday to last Saturday. =A0To be more specific, take this
> week which begins on Sunday, Feb 10 and ends Saturday, Feb 16. =A0When
> this report gets generated anytime this week, the start date should be
> Sunday Feb 3 and the end date should be Saturday Feb 9. =A0When the
> report is run next week, the start date/end date for that report
> should be Feb 10/Feb 16.
> I figured out the date expression for the start and end dates and set
> them as the default for this report in Visual Studio. =A0However, when I
> upload them to my Report Server and set the data driven subscription
> (DDS) to use the default for those date parameters, it won't let me.
> So my question is, in the DDS itself, can I use an expression for the
> date paramenters? =A0If the answer is no, then I'm obviously not getting
> the syntax correctly.
> Any help would be greatly appreicated.
Correction on the last sentence - I meant to say "If the answer is
YES,..."|||Did you ever get a fix on this, as I am having the same problem. In my report
definition in VS I have a multi-select YEAR parameter that is dynamically
generating values using the query (a google query :).
***********
SELECT (YEAR(GETDATE()) -5) + 5*5*(a-1)+5*(b-1) + c AS [YEAR] FROM
(SELECT 1 a UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION
ALL SELECT 5) x
CROSS JOIN
(SELECT 1 b UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION
ALL SELECT 5) y
CROSS JOIN
(SELECT 1 c UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION
ALL SELECT 5) z
WHERE 5*5*(a-1)+5*(b-1) + c <= (YEAR(GETDATE())+1-(YEAR(GETDATE()) -5))
ORDER BY 1
*************
and default values for current year and last year using Year(Now) and
Year(Now)-1. This is causing an error in data-driven subscription
rsReportParameterValueNotSet. The odd thing is that this only occurs if other
parameters are set to "Query Results Field". If all parameters are set to
"Static Selection" and "Use Default" is checked everything works fine.

No comments:

Post a Comment