none
Problem with default date format SSRS 2017 RRS feed

  • Question

  • Hello everyone,

    I have problem with default date picker format in properties field. As i know Reporting Services should import date format from Windows short date.

    I need to set default date format to YYYY-MM-dd, but default for my region(poland) format is dd.MM.yyyy, i change it to YYYY-MM-dd, but it doesn`t work.... 

    I had tried change Culture in ReportViewer.aspx to "en-CA", becouse they have correct date format (yyyy-MM-dd) and it`s work for few reports, but when report have date format default value: =DateAdd("m",-3,Today()) i still get old date format what can you see at screen below:

    I really need help..

    if someone need i can tell more information

    best regards,
    Patrick


    Tuesday, June 18, 2019 1:33 PM

Answers

  • I think found solution thanks to your last reply.

    I have back to default region settings:
    Region: Poland
    Short Date format: yyyy-MM-dd

    I have delete culture settings from ReportViewer.aspx and added your code(to show what culture is used in report).

    With upper settings in the Date Picker i have format like dd.MM.yyyy


    But when i add (what is weird for me) Culture="pl-PL" in ReportViewer.aspx i have date format like i need: yyyy-MM-dd

    This is really weird, becouse as I know ReportViewer.aspx by default use Culture from Windows(for me is pl-PL), what i check by show '<%= System.Globalization.CultureInfo.CurrentCulture.Name %>' when opens report. And now i have overwritten culture settings from default pl-PL to custom: pl-PL...


    I hope my explain is clear, and understandable.


    Many thanks to you Eric, without your help would not find solution.
    Best Regards,
    Patrick 


    • Marked as answer by Patrick7936 Tuesday, June 25, 2019 10:21 AM
    Tuesday, June 25, 2019 10:21 AM

All replies

  • Hi Patrick7936

    If possible you could try to change the region format in you server ‘s system setting .

    See:

     

    Then create a new report or project and see is the date picker works fine or not .

    Hope it can help you.

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Wednesday, June 19, 2019 2:22 AM
  • Hi Eric,

    Thanks for your reply,

    When i change region to Poland i got date format: dd.MM.yyyy
    I need to change date format to: yyyy-MM-dd

    I change format for region Poland to date: yyyy-MM-dd, but it`s doesn`t change it under Reporting Services.. 
    After change i still see in RS date format: dd.MM.yyyy

    My region/date settings in RS server

    I have  tried change region to Canada, becouse they have date format yyyy-MM-dd, but i observe odd situation in some reports, for example:


    Report have parameter: "Date From" and "Date to", Date from have correct format (yyyy-MM-dd), but Date to default have mm.DD.yyyy only after selecting date manually i have correct format.. It generate problems when subscriptions run report and send to users, becouse i gets two diffrent date formats in output...

    Another problem with date is report what i have set use default date format and added default value as: =DateAdd("m",-3,Today())
    In this report i gets date format like in my screenshoot in first post. After select another date from calendar for 1 second i get date in correct format (yyyy-MM-dd), but in next second i get dd.MM.yyyy hh:mm:ss


    Best Regards,
    Patrick

    Wednesday, June 19, 2019 8:11 AM
  • Hi Patrick7936

    According to your description , seems that you could get the correct date format from the date picker right ?

    While ,after a moment ,seems the date format have changed right ?

    If possible you could offer the detailed report parameter setting and the detailed issue screenshot in subscription or in report builder preview to us for more further research .(gif image or the detailed rdl file are better )

    You could try to post your file (no sensitive message ) to the cloud disk .

    By the way , what the detailed os version you use ?

    Hoping for your reply.

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Wednesday, June 19, 2019 9:44 AM

  • OS: Windows Server 2016 Standard

    I could get the correct date format from the date picker only if i set in C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\Pages\ReportViewer.aspx Page Culture="en-CA"

    I would like to focus why Reporting Services doesn`t read the date format from windows to the date picker, i think problem is here and if i solve it i think problem with reports will be solved too.

    Below i attach problem with the date picker format. It looks like RS try change date format, but it refreshing to old format.. (maybe its another problem)


    Best Regards,
    Patrick

    Wednesday, June 19, 2019 10:44 AM
  • Hi

    According to your description , seems that it is related to the asp page culture setting , if you have set the correct region and the date format in server system , seems it would only get the correct resultset in report builder preview mode in server . while in browser, the culture ,region ,date format for the browser is not change ,still the polish (might be ).

    You could try to add the following script in the ReportViewer.aspx :

       var culture = '<%= System.Globalization.CultureInfo.CurrentCulture.Name %>';

       var cultureDisplayName = '<%= System.Globalization.CultureInfo.CurrentCulture.DisplayName %>';

       alert(culture)

       alert(cultureDisplayName)

    then check if it return the correct culture (en-us) in browser , if not try to change the page culture like you do .

    For the detailed culture setting about the asp page ,see :

    HOW TO: Set Current Culture Programmatically in an ASP.NET Application

    Hope it can help you .

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    • Proposed as answer by Mitarai Queen Monday, June 24, 2019 3:04 AM
    Thursday, June 20, 2019 5:46 AM
  • Hi

    How is your issue going these days , If you have solved your issue,  you could share you solution or mark the appreciated reply as answer . so that other members in this forum could get benefited from it .

    Thank you for your support and understanding.

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Monday, June 24, 2019 3:04 AM
  • Hello Eric,

    I had checked, and:

    If i make no changes in ReportViewer.aspx (about culture settting) and put your code i get 2 message boxes:
    1. pl-PL
    2. Polish (Poland)

    So, SSRS read region correctly, but date format is: dd.MM.yyyy - why i get this date format? If you can see in aspx polish date short date format is yyyy-MM-dd

    When i change Culture to en-CA i get correct date format. Still i haven`t solve for this issue...

    Now i know is SSRS using region from Windows, but why i get date format: dd.MM.yyyy?
    Below link with date formats for all culture.

    https://www.basicdatepicker.com/samples/cultureinfo.aspx

    Best Regards,
    Patrick

    @@EDIT

    Additionaly i think my solution (change culture for ReportViewer.apsx) isn`t working good, becouse i changing format only for this one page, not for whole SSRS... In the Date Picker i have correct format, but in rendered report i still have bad format.. So I have to go back to start of topic. I need change date format for whole SSRS. In previous versions (2014 and 2008) i have correctly date format

    Monday, June 24, 2019 7:46 AM
  • Hi

    Seems it would read the browser language setting to adjust your date format .

    If you are use the browser with polish language , whatever then language you set for the report ,seems it would convert to the polish date format in report.

    If you try to change the browser with English and move to the top , then it would render in the correct date format .

    Hope it can help you.

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Tuesday, June 25, 2019 8:10 AM
  • I think found solution thanks to your last reply.

    I have back to default region settings:
    Region: Poland
    Short Date format: yyyy-MM-dd

    I have delete culture settings from ReportViewer.aspx and added your code(to show what culture is used in report).

    With upper settings in the Date Picker i have format like dd.MM.yyyy


    But when i add (what is weird for me) Culture="pl-PL" in ReportViewer.aspx i have date format like i need: yyyy-MM-dd

    This is really weird, becouse as I know ReportViewer.aspx by default use Culture from Windows(for me is pl-PL), what i check by show '<%= System.Globalization.CultureInfo.CurrentCulture.Name %>' when opens report. And now i have overwritten culture settings from default pl-PL to custom: pl-PL...


    I hope my explain is clear, and understandable.


    Many thanks to you Eric, without your help would not find solution.
    Best Regards,
    Patrick 


    • Marked as answer by Patrick7936 Tuesday, June 25, 2019 10:21 AM
    Tuesday, June 25, 2019 10:21 AM