Showing posts with label deployed. Show all posts
Showing posts with label deployed. Show all posts

Thursday, March 22, 2012

Date parameter works in report designer but not when deployed.

I use the following expression as the default parameter for a report
called 'Start':
=IIF(DATEPART("d",today()) >= "12",DateSerial(Year(today()),
Month(today()), 1) ,DateSerial(Year(today()), Month(now)-1, 1))
The query then uses the parameter to filter the data so I only get the
transactions I want depending on what day of the month it is 'today',
i.e., 'Date >= @.start'
This works fine in Report Designer in VS. However, it doesn't work once
the report is deployed and I run it through Report Manager - I get all
the transactions.
Anyone know why this is happening? I'm still using SQL2000I see two problems with your expression:
1) DatePart returns an integer not a string
2) With DateSerial(Year(today()), Month(now)-1, 1) what happens when now is
January? What Month is January minus 1?
I suggest you use the following expression:
=Iif( DatePart(DateInterval.Day, Today()>=12, DateSerial(Year(Today()),
Month(Today()),1), DateAdd(DateInterval.Month, -1, DateSerial(Year(Today()),
Month(Today()),1)))
HTH
--
Magendo_man
Freelance SQL Reporting Services developer
Stirling, Scotland
"paddydog" wrote:
> I use the following expression as the default parameter for a report
> called 'Start':
> =IIF(DATEPART("d",today()) >= "12",DateSerial(Year(today()),
> Month(today()), 1) ,DateSerial(Year(today()), Month(now)-1, 1))
> The query then uses the parameter to filter the data so I only get the
> transactions I want depending on what day of the month it is 'today',
> i.e., 'Date >= @.start'
> This works fine in Report Designer in VS. However, it doesn't work once
> the report is deployed and I run it through Report Manager - I get all
> the transactions.
> Anyone know why this is happening? I'm still using SQL2000
>

Date Parameter in Reports Manager

I have one master report and 4 linked reports. I deployed a report and set defaults for BeginDate and EndDate as =Today(). I have 4 linked reports that I need to change the date parameters for each. For instance the first linked reports needs to be BeginDate =Today() and the EndDate as =Today()+30. So in my linked report, I tried to change the EndDate to =Today()+30 and an error, 'The value provided for the report parameter 'BeginDate' is not valid for its type.'

So I can't put =Today() or =Today()+30 in the parameters once I override the defaults. Can someone tell me what I'm missing here?

Thanks, Iris

Not sure if this will help but,

Try this:

=DateSerial(Year(Now), Month(Now), Day(Now)+30)

Instead of: Today()+30

|||I still got the same error. When I click 'override default' and put in the expression and click apply, I get this error.|||

When you say you have one master report and four linked reports. What does that mean?

The only way I can help you is to understand what your saying. Are you linking from within the master report by setting up four links using text boxes? Are you displaying data in a table and upon clicking on a field you are using the jump to report? What are your parameters initial settings for the StartDate and EndDate . ie(DateTime, String, etc...) I'm not sure just exactly what it is that your doing. If your attempting to pass a parameter value to a sub-report and change the default value, or setting up a subscription and over-riding the default value. Please explain further and I'll try to provide an answer.

|||

I've decided to use 'Available Values' in the Report Parameters area instead. Someone else tested and got the same error I did.

But basically, my idea came from an article located at www.databasejournal.com/features/mssql/article.php/3613751

Thanks,

Iris

Date Parameter in Reports Manager

I have one master report and 4 linked reports. I deployed a report and set defaults for BeginDate and EndDate as =Today(). I have 4 linked reports that I need to change the date parameters for each. For instance the first linked reports needs to be BeginDate =Today() and the EndDate as =Today()+30. So in my linked report, I tried to change the EndDate to =Today()+30 and an error, 'The value provided for the report parameter 'BeginDate' is not valid for its type.'

So I can't put =Today() or =Today()+30 in the parameters once I override the defaults. Can someone tell me what I'm missing here?

Thanks, Iris

Not sure if this will help but,

Try this:

=DateSerial(Year(Now), Month(Now), Day(Now)+30)

Instead of: Today()+30

|||I still got the same error. When I click 'override default' and put in the expression and click apply, I get this error.|||

When you say you have one master report and four linked reports. What does that mean?

The only way I can help you is to understand what your saying. Are you linking from within the master report by setting up four links using text boxes? Are you displaying data in a table and upon clicking on a field you are using the jump to report? What are your parameters initial settings for the StartDate and EndDate . ie(DateTime, String, etc...) I'm not sure just exactly what it is that your doing. If your attempting to pass a parameter value to a sub-report and change the default value, or setting up a subscription and over-riding the default value. Please explain further and I'll try to provide an answer.

|||

I've decided to use 'Available Values' in the Report Parameters area instead. Someone else tested and got the same error I did.

But basically, my idea came from an article located at www.databasejournal.com/features/mssql/article.php/3613751

Thanks,

Iris

Thursday, March 8, 2012

Date Format Problem

i have change my field like that format

= format(Fields!TimeStart.Value, "dd -MMM- yyyy")

Its working perfectly.Once i deployed my report this format is not working

once deploy my report its showing that field fill dd -MMM- yyyy why?there is no date in that field?

i dont understand can anybody know this one.

From the description it sounds like the TimeStart field is of type DateTime when running in preview (running based on the cached data from the .rdl.data file), but of type string when running on the report server when running against live data.

Are you running against the same data source in your design environment and the server?

Did you click the little green refresh icon in the preview toolbar (this will update the cached .rdl.data file kept by report designer)?

-- Robert

|||

thanx for your reply

its giving same problem.Its actually live data.Its giving once deploy my report only.