web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to convert date from gregorian to hijri in SSRS report?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

In SSRS reports we have some dates like TransDate and showing in gregorian date format and requirement is to show same date in hijri in next column.

Gregorian: 19/12/2017

Hijri Data: 01/03/1439

But we need to show Hijri date in Arabic alphabets, like in the image below.

gdate.JPG

1. Please guide is there any class and functions that take Gregorian date and convert into Hijri date on report level?
2. Or do we have in x++?
3. Should we add new columns for Hijri dates in temp tables and in RDP class insert after converting to Hijri Date and alphabets?
We need Hijri dates to show on reports only.

Regards,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Fx Profile Picture
    425 on at

    Hello,

    I've maybe half of the solution, maybe you can complement by using CultureInfo namespace to change the text style:

    Here is the date conversion

        System.Globalization.UmAlQuraCalendar hijriCal = new System.Globalization.UmAlQuraCalendar();
        System.Globalization.GregorianCalendar gregCal = new System.Globalization.GregorianCalendar();
        System.DateTime dt = new System.DateTime(2013, 9, 29, gregCal);  // Gregorian
        str yearStr, monthStr, dayOfMonthStr;
        
        yearStr = hijriCal.GetYear(dt);                      // 1434
        monthStr = hijriCal.GetMonth(dt);                    // 11
        dayOfMonthStr = hijriCal.GetDayOfMonth(dt);          // 23
        
        info(dt.ToString());                                    //9/29/2013 12:00:00 AM
        info(dayOfMonthStr + '/' + monthStr + '/' + yearStr);   //23/11/1434


     Regards 

    FX

  • Rana Anees Profile Picture
    1,813 on at

    Thanks François,

    That sounds ok. Now the remaining part is to convert into Arabic numeric.

    Regards,

  • Rana Anees Profile Picture
    1,813 on at

    some ideas please to convert numbers into Arabic numeric. Thanks.

  • Verified answer
    Mahmoud Hakim Profile Picture
    17,887 on at
    [deleted]
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    I thought this is already supported by SSRS and doesn't require any custom code.

    Please try using a date value and setting the Language property of the text box to an arabic language the Calendar property to Hijri.

  • Rana Anees Profile Picture
    1,813 on at

    Thanks Martin,

    That will be great. The language and calendar properties are at SSRS report level? Could you please help with more detail.

    Thanks again.

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    They're are properties of TextBox control in SSRS designer.

    SsrsTextboxProps.png

    Just note that I can't test at the moment; I just assume it'll give you what you need.

  • Rana Anees Profile Picture
    1,813 on at

    Hii Martin, I set Calendar and Language for date text-boxes and it works fine. 
    Now the thing is to show Hijri date in Arabic letters. 
    Ca we do it on SSRS level? 

    hijridt.png 

    Thanks,

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    I'm sorry, but I don't know the answer and I can't start playing with it in the moment. I suggest you ask your question in an SSRS forum; there you'll find more experts in SSRS than in AX forums.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans