
Hi Members.
My requriment is to convert date from gregorian format to hijri format and need to print in SSRS report.
First i created a global method.The code is as shown below:
static str hijriDate(Date _transDate)
{
TransDate transDate = _transDate;
int HijriDate, HijriMonth;
str Year,finaldate, Hijridat, HijriMnth, HijriYr;
CalendarConverter CalendarConverter;
CalendarConverter = new CalendarConverter(PreferredCalendar::Hijri);
HijriDate = CalendarConverter.dayofmth(transDate);
HijriMonth = CalendarConverter.mthofyr(transDate);
Year = CalendarConverter.yearStr(transDate);
Hijridat = int2str(HijriDate);
HijriMnth = int2str(HijriMonth);
finaldate = strFmt("%1/%2/%3", Year, HijriMnth, Hijridat);
return finaldate;
}
then i extend the DP Class PSAProjInvoiceDp.The code is show below:
[ExtensionOf(classstr(PSAProjInvoiceDP))]
final class ITPsaProjInvoiceDP_Extension
{
protected void populatePSAProjInvoiceHeaderTmp()
{
next populatePSAProjInvoiceHeaderTmp();
PSAProjInvoiceHeaderTmp tmpPSAProjInvoiceHeader;
tmpPSAProjInvoiceHeader.InvoiceDate = str2Date(ITGlobal::hijriDate(projInvoiceJour.InvoiceDate) , 123);
}
}
At last the date is not getting the desired hijri format.
Please help me in this regard.
Thanks in advance