Thursday, March 22, 2012

Date parameters: yesterday's date

I'm having a problem in the report designer with setting yesterday's date as
the default date parameters (Reporting From 'yesterday' To 'yesterday') for a
report. Both the From & To parameters need to default to yesterday, but the
user can enter a different date if they wish.
I've tried using =DateTime.Now().AddDays(-1) as well as =Today.AddDays(-1),
but I always get the following error when trying to preview the report in the
designer:
An unexpected error occurred while compiling expressions. Native compiler
return value: â'[BC30260] 'EH_ReportingFrom' is already declared as 'Class
EH_ReportingFrom' in this class.â'.
I'd appreciate any suggestions on how I can get this to work.
--
Jadranka Krapic
DBA
Stargate Technologies
(www.stargatetech.com.au)Do you have a dataset called "ReportingFrom" in the report? If yes, either
rename the dataset or the parameter to resolve that error. BTW: this won't
happen on RS 2005.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jadranka" <Jadranka@.discussions.microsoft.com> wrote in message
news:5E3DE809-7FD0-46A2-8CBB-3B4AA943F35B@.microsoft.com...
> I'm having a problem in the report designer with setting yesterday's date
> as
> the default date parameters (Reporting From 'yesterday' To 'yesterday')
> for a
> report. Both the From & To parameters need to default to yesterday, but
> the
> user can enter a different date if they wish.
> I've tried using =DateTime.Now().AddDays(-1) as well as
> =Today.AddDays(-1),
> but I always get the following error when trying to preview the report in
> the
> designer:
> An unexpected error occurred while compiling expressions. Native compiler
> return value: '[BC30260] 'EH_ReportingFrom' is already declared as 'Class
> EH_ReportingFrom' in this class.'.
> I'd appreciate any suggestions on how I can get this to work.
> --
> Jadranka Krapic
> DBA
> Stargate Technologies
> (www.stargatetech.com.au)|||Thanks for the quick response!
No, I don't have a ReportingFrom dataset in the report. The only dataset on
the report is called UpfrontFeesPayments, which calls a stored procedure.
Any other ideas?
"Robert Bruckner [MSFT]" wrote:
> Do you have a dataset called "ReportingFrom" in the report? If yes, either
> rename the dataset or the parameter to resolve that error. BTW: this won't
> happen on RS 2005.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Jadranka" <Jadranka@.discussions.microsoft.com> wrote in message
> news:5E3DE809-7FD0-46A2-8CBB-3B4AA943F35B@.microsoft.com...
> > I'm having a problem in the report designer with setting yesterday's date
> > as
> > the default date parameters (Reporting From 'yesterday' To 'yesterday')
> > for a
> > report. Both the From & To parameters need to default to yesterday, but
> > the
> > user can enter a different date if they wish.
> >
> > I've tried using =DateTime.Now().AddDays(-1) as well as
> > =Today.AddDays(-1),
> > but I always get the following error when trying to preview the report in
> > the
> > designer:
> >
> > An unexpected error occurred while compiling expressions. Native compiler
> > return value: '[BC30260] 'EH_ReportingFrom' is already declared as 'Class
> > EH_ReportingFrom' in this class.'.
> >
> > I'd appreciate any suggestions on how I can get this to work.
> >
> > --
> > Jadranka Krapic
> > DBA
> > Stargate Technologies
> > (www.stargatetech.com.au)
>
>|||I've gone back and re-created the parameters using different parameter names.
It works now (using both =DateTime.Now().AddDays(-1) and =Today.AddDays(-1)).
Thanks for your help.
"Jadranka" wrote:
> Thanks for the quick response!
> No, I don't have a ReportingFrom dataset in the report. The only dataset on
> the report is called UpfrontFeesPayments, which calls a stored procedure.
> Any other ideas?
> "Robert Bruckner [MSFT]" wrote:
> > Do you have a dataset called "ReportingFrom" in the report? If yes, either
> > rename the dataset or the parameter to resolve that error. BTW: this won't
> > happen on RS 2005.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "Jadranka" <Jadranka@.discussions.microsoft.com> wrote in message
> > news:5E3DE809-7FD0-46A2-8CBB-3B4AA943F35B@.microsoft.com...
> > > I'm having a problem in the report designer with setting yesterday's date
> > > as
> > > the default date parameters (Reporting From 'yesterday' To 'yesterday')
> > > for a
> > > report. Both the From & To parameters need to default to yesterday, but
> > > the
> > > user can enter a different date if they wish.
> > >
> > > I've tried using =DateTime.Now().AddDays(-1) as well as
> > > =Today.AddDays(-1),
> > > but I always get the following error when trying to preview the report in
> > > the
> > > designer:
> > >
> > > An unexpected error occurred while compiling expressions. Native compiler
> > > return value: '[BC30260] 'EH_ReportingFrom' is already declared as 'Class
> > > EH_ReportingFrom' in this class.'.
> > >
> > > I'd appreciate any suggestions on how I can get this to work.
> > >
> > > --
> > > Jadranka Krapic
> > > DBA
> > > Stargate Technologies
> > > (www.stargatetech.com.au)
> >
> >
> >|||I've also done this by crating another data set with a single sql query
that returns yesterday, the first of the month, and the end of the
month. That way I can put them in a drop down, or let them be
defaults.
Works like a charm.

No comments:

Post a Comment