"The value provided for the report parameter 'enddate' is not valid for its type. (rsReportParameterTypeMismatch)" in SSRS v8 - reporting-services

I am getting the above error whenever I try to run the report. My region settings are set to date format "dd-MM-yyyy', the calendar control displays the date in that format as expected but when I run the report I get the above error. I have checked tregion settings, made sure the report language property is set to the correct regional language (in this case en-ZA) but the report still seems to expect the date in American format and only works when I manually enter the date in American format instead of selecting via the calendar control which returns it in regional format.
Anyone know why it would return this error when it seems that all the date formats are set the same both on the machine and within the report?

Related

How can I change the date format of a date/time SSRS parameter - this is specific to en-SC culture?

I have an SSRS report that has a start and end date parameter (set to the date/time type) so that the user can choose the date range. The report sets the Localization Language value based on a parameter that is passed in at run time.
This works great for en-GB but we have a customer in the Seychelles and when the localization is set to en-SC, the date format of the 2 parameters defaults to mm-dd-yyyy, but this is incorrect as the date format should be dd-mm-yyyy. Because of this, the user is unable to set the dates correctly as choosing the 31st January for example gives a 'The value provided for the report parameter 'startdate' is not valid for its type' error.
When I drop down the date picker and pick 31st January, it fills the date in as 31/01/2023 but then displays the error. I have my Windows Region set to "Seychelles" and Regional Format to "English (Seychelles)".
Is there anything I can change to get this to work or is it a bug in SSRS?

Changing the SSRS date picker format to DD/MM/YYYY

I have seen this issue posted a few times but there does not appear to be a solution for what I am seeing. I have a paginated SSRS report that requires a date input from the drop-down calendar. Upon entering, say, January 21st 2020, the UI is then displaying the date chosen as 1/21/2020, for example here. I need it to be 21/01/2020. Some points of note:
* all location settings for both the report server and the client browser are set to English (United Kingdom) and all date format settings are set to dd/mm/yyyy within the Windows settings on both the report server and client machine. All client browser language settings are English-UK in both IE and Chrome
* the variable is a DateTime data type
* this is a paginated SSRS report being displayed on a Power BI host server
* this is affecting all reports on this server
* the date field is not necessarily returned in the report, so converting the data is not applicable here.
* PBI version 15, SQL Server 2016
I have seen responses talking about expressing the field into the correct format, eg =CDate(Fields!BirthDate.Value) or =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate) however this does not appear to change anything (when it doesn't error).
I'm at a total loss as to where this Americanization of the date is coming from. Any thoughts?
Unfortunately, the report server's location settings and the user's browser's location settings don't (by default) do anything to the report formats because the report has its own Language property that is set by default to en-US. So unless you modify this property, you are always going to get US formats. You access this property on the report's Property panel.
Now you could set it to en-UK but a better solution is to set it to the user's internationali[s|z]ation setting by using =User!Language. Now you can use d as the cell Format property for the user's regional short date format.
Handy formats that use the user's regional formats are:
d = short date format
N2 = number with 2 decimal places
N0 = number with no decimal places
P0 = percent with no decimal places

In SSRS, a Date Time parameter on Preview is not matching the deployed report

In SSRS, a Date Time parameter on Preview is not matching the deployed report. Is this something someone else has encountered? The RDL code is identical. Is it the fact that, sometimes, a local preview is just a simulation of functionality? Is it because the display in preview sometimes uses cached data?
I have a SSRS report that, when I preview it in Visual Studio locally, the date shows as 2/10/2019 but when the RDL code is deployed on the server, the date shows as 2/7/2019.
The date time variable is based on a parameter on the report, called rundate, and it has a Default Value of 2/10/2019.
So I think the same thing should happen on the Report Server that happens locally in preview mode.
The report has four datasets and, as a test, I have set each four to have the SQL line that sets the rundate value like so:
SET #rundate = '2019-02-10'
but on the report server, when I load the report, it throws this error:
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
It is in a cascading tabbed error message that looks like this:
An error occurred during client rendering.
An error has occurred during report processing.
Query execution failed for dataset 'ThirdDataset.
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
So, why does it run locally and not on the server? The "ThirdDataset" is a false name I have given here. The actual name is redacted. But, I have noticed that this would be the first dataset run if they are run alphabetically. So this leads me to the question: why doesn't the report recognize this as a parameter and why does it complain that it is not declared?
============
UPDATE:
I have set the rundate to be part of a data-driven subscription in a report like so:
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Which is two days ago. Since it is 2/11/2019 today, the rundate parameter passed to the SSRS report on the server should be 2/9/2019.
For fun, to test this out, I set the Default Value rundate parameter to be 8/8/2018 in hopes that the data-driven report would set it properly.
In preview mode locally on Visual Studio, a textbox that set to show the [#rundate] Expression shows 8/8/2018 which is what I would expect, but the Datasets are designed to run off this parameter. Since there is nothing that the sql should retrieve from the database that is that old, the graphs and charts in preview mode should turn up completely empty. Why do they show data?!
Next, let's see what the emailed subscription alert says. It had the date of 2/11/2019 12:00:00 AM. If the data-driven subscription ran like it shouold ahve run, it should of had the date of 2/9/2019 from
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Why did this not work?
On the SSRS server, the RDL file has a parameter default value of 2/11/2019 12:00:00 AM but why did the report get THIS default value? What am I doing wrong and how can I fix this?
As a test, I set this default date/time parameter to 12:12:34 for its time to see what would happen. It reveiled that, yes, this is the date time stamp that is being sent to the report. So I unchecked the "Has Default" box
Then, I noticed in the Step 5 of the data-driven subscription I could not advance to Next > without making a small change:
So, what should happen? Will it show the wacky 8/8/2018 value? Will it show the date from two days ago?
Default values for report parameters are deployed only once to the report server, and then they keep their default value after subsequent deployments. This is so that default parameter values used in development don't overwrite the desired parameter defaults on the production server.
So it looks like when the report was first deployed, #rundate had the default value 2/7/2019 but has since been changed on the local report to 2/10/2019. Go into your report server, find the report and go into the Report Parameters section to edit the parameters and change the default value to what you want it to be (deleting the report from the report server and re-deploying it with the updated parameter will have the same effect, but note that the parameter will maintain that default value going forwards). Alternatively, set the report parameter using an expression so that it is continually up to date.
Regarding updating your parameter value in the Sql statement using the SET statement, you can't actually do it that way - you need to set it in the report's parameter list so that SSRS can set the parameter value. Consequently, your databse server is complaining that you are trying to set the value of a local variable that hasn't been defined in your Sql statement, and thus throws an error message.
So you need to set up the Report Parameters in the report parameters section in the report designer. Your Sql can then reference your parameters like so:
SELECT * FROM MyTable WHERE SomeDate >= #rundate
The parameters normally get mapped into your dataset automatically but you might want to check this by going into the Parameters settings on your dataset to make sure. If the parameter doesn't exist there, set it up.
After lengthy trial and error, I found that the answer was to NOT have the parameter set to have a default value on the SSRS Report Server.

SSRS filter date time not working

Report SSRS in window 10 and open from IE 11
my computer filter date not working (not show image calendars)
How to fixed .
thank you.
Expanding on WEI_DBA, it looks like you need to set the default value of your Start Date parameter to ="3/16/2017 0:00:00" since your date format has months and days reversed.
Note that this can be confusing when you have a server with a different region setting than your workstation. The report is fine to develop locally and will then generate this error when deployed to your server.
In the parameter pane, right-click on Start Date and select Parameter Properties. Find "Data Type:" in the middle of the dialog and change the drop down to be Date/Time. Do the same for End date.
A date/time parameter will will show the date picker and will ensure you are passing a properly structured date value into your dataset query, regardless of your culture/language settings.

what is correct format to pass Today as work item createdDate parameter

I have created data set (as TFS drill through report) using TFSOlap data source which is displaying all bugs based on created date. Now, I want to pass date range as parameter from main report so drill through report displays data for the bugs created between given date range. I am getting error "string.. can not be converted to date type" I am using following formatting expression at drillthrough report parameter:
="[Work Item].[System_CreatedDate].&[" + FORMAT(Parameters!FromWorkItemSystemCreatedDate, "yyyy-MM-dd") + "T00:00:00]"
Please let me know what type of expression should be used to avoid error. I tried with using CDate() instead of FORMAT but still getting problem.