Date Values changed at run time for zh_CN(Chinese locale) in BIRT

k_Chaitanya
edited February 11, 2022 in Analytics #1

Hi,

we are selecting the Date values(Datepicker widget) from parameter screen and upon clicking on Ok button to run the report, the values are getting changed than the selected values.

please find the below images of the Parameter selection,output

1) Date values selected as From: 25/01/2019 To: 25/01/2019

2) These values are changed as 2021-01-01 at run time and passed to the report and making report execution resulting in no data

Could you please let me know is there any workaround to have the user selected values passed to the report.

Thanks,
Chaitanya

Comments

  • Could you please post a screenshot of the Designer's Help > About window so that I can attempt to replicate the issue?

    Warning No formatter is installed for the format ipb
  • k_Chaitanya
    edited January 26, 2019 #3

    Hi Jeff,
    Thanks for your reply.

    is this the screenshot you are asking for?

    if not, could you please guide me where can i find that option or simply provide a example screen shot. i will refer it and send you Help>About screen shot of ours

    FYI we are seeing the issue happening when running the report from our application not from Report Eclipse

    Thanks,
    Chaitanya

  • Thank you for posting the screenshot. It has the information I was looking for. Unfortunately, the oldest version of BIRT I have installed is from 2015. Your version was released in 2012 and a custom application is involved. Can you try changing the locale to zh_HK and see if the dates work correctly? If those dates work correctly, then this might be a bug related to your locale.

    Warning No formatter is installed for the format ipb
  • Hi Jeff,

    I tried changing the locale to zh_HK but didn't work as the Date parameter in our report is defined to take short Date format, so i changed it to Unformatted then what ever date value we are passing from prompt page is going to the report.

    please see the below images

    values getting wrong when the Date parameters formatted as Short Date:

    values getting correct when the Date parameters formatted as Unformatted:

    But we need to fix it for zh, zh_CN, zh_TW locales. could you please suggest me where we can resolve this and is this issue related to BIRT or any changes we have to do it on report side ?

    Thanks,
    Chaitanya

  • Hi Chaitanya,

    Thank you for providing the screenshots. One thing is still not clear to me. In your second post, you said, "FYI we are seeing the issue happening when running the report from our application not from Report Eclipse." Does that mean that you tested the dates by running a test report in the Eclipse Designer using the zh_CN language? If you tested or are able to run a test in the Designer, do the dates display properly?

    Also, if the dates work properly when running in the Designer, could you kindly provide more details about how your application interacts with the parameter date values. You said, "the Date parameter in our report is defined to take short Date format". Can you please describe how it works or provide an example?

    Warning No formatter is installed for the format ipb
  • Hi Jeff,

    The reason i put that comment in second post is to let you know about the issue is from our Application as we are not able to test it fully in designer when the locales involved(The report execution from Designer will show results for english locale with dates displayed properly and i even tried changing the locale to zh_CN but the output is defaulted to english locale only). sorry, i misquoted the comment.

    In our Application, the report date parameters will be selected by Date picker widget. the Date picker widget will look into date format in locale specific js files (Ex: WM_zh_CN.js, WM_en_US.js ) and display the date as per that format in UI.

    EX: the JS file defined for WM_zh_CN locale

    **wmsMonthNames =
    ["一月",
    "二月",
    "三月",
    "四月",
    "五月",
    "六月",
    "七月",
    "八月",
    "九月",
    "十月",
    "十一月",
    "十二月"];

    wmsDayNames =
    ["週日",
    "週一",
    "週二",
    "週三",
    "週四",
    "週五",
    "週六"];
    wmsToday = "今天"

    wmsShort = "d/m/Y"
    wmsAltFormat = "d/m/y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d"**

    For Date parameter ShortDate format, please see the below example

    Ex: we defined zh_CN date format as d/m/Y to display Date in UI, if user selects date say today's date from date picker it will come as 30/01/2019 and when passed to the report we defined it to have short date format(M/d/y) means we are expecting it to come like 01/30/19 but in the process the value is getting changed at runtime, so for my testing i changed the date parameter format as unformatted and able to get correct results for zh_HK but still issue exists for zh, zh_CN, zh_TW locales.

    Thanks,
    Chaitanya

  • Thank you again for the detailed description. Is there a reason the date must be passed to the report in "short" format if that is causing the value to change? Can you pass it as yyyy-MM-dd? The date should not be changed to the wrong value if passed in that format. You can re-format the date in the report for display or for filtering if necessary. I apologize if I am missing something obvious. I do not have much experience running reports outside of iServer / iHub.

    Warning No formatter is installed for the format ipb
  • Yes Jeff we have made the Date Parameter widget to show and pass value in the user locales format to the report. so, it is not possible to pass it in a common format(yyyy-MM-dd).if we do so we lose support for multiple locales for our application.

    can you please confirm or tell Does BIRT support parsing of date values for zh, zh_CN, zh_TW locales because we don't have issue with zh_HK locale, i wonder why its creating issue with zh, zh_CN, zh_TW locales.

    Thanks,
    Chaitanya

  • jfranken
    edited January 31, 2019 #10

    There might be a bug
    (https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=all&content=chinese%20locale%20date&no_redirect=1&order=Importance&product=BIRT&query_format=specific). I have not had time to look at the list.

    I will try to find and install the version you are running so that I can test the dates.

    Warning No formatter is installed for the format ipb
  • Thank you jeff, i will look at the list and see if anything resolves my issue and will wait for you confirmation on Testing Dates

    Thanks,
    Chaitanya

  • jfranken
    edited February 1, 2019 #12

    Hi Chaitanya,

    I tried to test the dates in your build (20120216-1857). Everything ran correctly except I could not view the parameters when running the report. Go figure. Since that build didn't work, I ran some tests using other versions of the BIRT designer.. In those tests, I encountered the same issue that you are seeing with the Chinese dates. I am not sure if it is a bug or a new feature request regarding enabling the dd/mm/yyyy format in zh_CN. Either way, that date format is not supported even in newer versions of the designer.

    According to Wikipedia, the national standard date format for China is yyyy-mm-dd, see https://en.wikipedia.org/wiki/Date_format_by_country. The date format from Wikipedia works correctly in BIRT. It doesn't help with this issue, but it might explain why one format works and the other does not.

    I have one new idea. Is it possible to set the date parameter to a String in the report? I don't know if a String will accept the date being passed in. If setting the parameter to a String does not throw an error, the String format could be a solution to the issue. It will preserve the date value being passed in. You can convert it back to a date in the report if necessary. Just a thought.

    Warning No formatter is installed for the format ipb
  • Hi Jeff,

    Thanks for that wikipedia link, After referring to it i have searched in google about short date format for chinese locale and found the short date format for chinese locale is Y/m/d not d/m/Y,

    After changing the format as Y/m/d, we are now getting the correct values passed to the report. please find the below screen shots

    so we are making that change to zh, zh_CN, zh_TW locales in our application now.

    Thanks for all your help and prompt replies on this issue... :)

    Thanks,
    Chaitanya

  • That is great that you found a solution!

    Warning No formatter is installed for the format ipb