Sunday, February 19, 2012

Execution snapshots and datetime

Hello, I need some help with a problem i'm encountering:
I have a parameter named "startDate" defined in a report. The data type for
this parameter is DateTime and the default value I set in the report is
Non-queried with =Now() as the value. This value is sent to a SQL sProc.
When I run the report through my ASP.net page, it displays nicely.
I'm trying to use execution snapshots for this report with nightly email
subscriptions because the report returns large amounts of data and we can't
have it process the report at peak business hours. However when I try to set
up execution snapshots with this report, and set the startDate parameter
default value to =Now() in Report Manager, I get the error of "The property
of report parameter startDate doesn't have the expected type."
So then I changed the data type for parameter startDate to String and set
the value to =Now() in Report manager. At least now it takes the value. But
when trying to setup the snapshot again, I receive "Syntax error converting
datetime from character string" even though I use the convert function in
the SQL sProc. I need the snapshot to generate reports on a per week basis
and I can't hardcode a date in the parameter field like "9/9/2004". It has
to be =Now() so it can generate a snapshot per week automatically with that
weeks data. I've tried everything and i can't get it to work. Is there
anyway I can get Now() or DateAdd() to work in a datetime (or string if I
have to) field using execution snapshots? thank youYou cannot change an expression-based default value once the report is
published on the report server. When you type in =Now, then it is
interpreted as string "=Now" and *not* as expression.
You will need delete the report from report server, load the RDL file in
report designer, set the expression-based default value there (e.g. =Now or
=Today) and then republish the report to the report server.
Then you should be able to create execution snapshots without any issues.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mark" <idroppeddabomb@.hotmail.com> wrote in message
news:eq5E2bplEHA.1652@.TK2MSFTNGP09.phx.gbl...
> Hello, I need some help with a problem i'm encountering:
> I have a parameter named "startDate" defined in a report. The data type
for
> this parameter is DateTime and the default value I set in the report is
> Non-queried with =Now() as the value. This value is sent to a SQL sProc.
> When I run the report through my ASP.net page, it displays nicely.
> I'm trying to use execution snapshots for this report with nightly email
> subscriptions because the report returns large amounts of data and we
can't
> have it process the report at peak business hours. However when I try to
set
> up execution snapshots with this report, and set the startDate parameter
> default value to =Now() in Report Manager, I get the error of "The
property
> of report parameter startDate doesn't have the expected type."
> So then I changed the data type for parameter startDate to String and set
> the value to =Now() in Report manager. At least now it takes the value.
But
> when trying to setup the snapshot again, I receive "Syntax error
converting
> datetime from character string" even though I use the convert function in
> the SQL sProc. I need the snapshot to generate reports on a per week basis
> and I can't hardcode a date in the parameter field like "9/9/2004". It has
> to be =Now() so it can generate a snapshot per week automatically with
that
> weeks data. I've tried everything and i can't get it to work. Is there
> anyway I can get Now() or DateAdd() to work in a datetime (or string if I
> have to) field using execution snapshots? thank you
>

No comments:

Post a Comment