Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Report dates not working correctly if date format is not mm/dd/yyyy

The SSRS report works fine if the user's date format is something like:

MM/dd/yyyy

But if the date format is different, the date parameter is "cleared out" automatically after being set, IT DISAPPEARS, for example, this fails

enter image description here

Again, if you put a value in that "End Date" parameter, it automatically disappears.

Things I have tried:

Setting the report's Language property to: "en-us", User!Language and blank.

So clearly SSRS thinks the date being input is invalid and it clears it out.

What do I need to do to make this work?

like image 500
The One Avatar asked Apr 16 '19 16:04

The One


Video Answer


1 Answers

Possible workarounds

The following workarounds may solves this issue.

(1) Handling the parameters date format

If you do not want to edit all code, then it is easier to force the parameter data string format, make sure that all parameters passed to TO_DATE() function are in following format (or try to change the default date format from the OS regional settings):

dd-MMM-yyyy   example: 01-AUG-2019

(2) Forcing Culture info by editing ReportViewer.aspx

You can edit the ReportViewer.aspx file is located in the SQL Server reporting services directory, and force the culture info used within reports. Check out the following question it will give you more details:

  • I want Datetime Parameter in DDMMYYYY Format in ssrs report

(3) Changing the browser language settings

Check the following link (read Mike Honey and Nick St Mags answers):

  • SSRS Datetime Parameter value should display in DD/MM/YYYY format

You can check the following answer, it contains many workarounds that may give you some insights:

  • Oracle Date format exception in SQL Server Reporting Services
like image 195
Hadi Avatar answered Sep 28 '22 17:09

Hadi