Page 1 of 1
how to convert date type?
Posted: Thu Sep 01, 2011 10:52 am
by behrooz1364
Hi
i want my date textboxes show the date as shamsi(persian or farsi) date how can i change that?
no matter in code or in report file.
thank you in advance.
how to convert date type?
Posted: Fri Sep 02, 2011 2:27 am
by HighAley
Hello.
behrooz1364 wrote:i want my date textboxes show the date as shamsi(persian or farsi) date how can i change that?
no matter in code or in report file.
thank you in advance.
You can write your function on the Code tab in the begin of report, for example:
Code: Select all
namespace Reports
{
public class Report : Stimulsoft.Report.StiReport
{
public string DateToHijri(object date)
{
System.Globalization.HijriCalendar hijri = new System.Globalization.HijriCalendar();
DateTime greg = (DateTime)date;
int year = hijri.GetYear(greg);
int month = hijri.GetMonth(greg);
int day = hijri.GetDayOfMonth(greg);
return day.ToString() + "/" + month.ToString() + "/" + year.ToString();
}
Thank you.
how to convert date type?
Posted: Fri Sep 02, 2011 6:02 am
by behrooz1364
thank you
how to convert date type?
Posted: Sat Sep 03, 2011 10:44 am
by Andrew
Hello,
Let us know if you have additional questions.
Thank you.
how to convert date type?
Posted: Mon May 28, 2012 5:51 pm
by Mohamad Hoosein Fakhravary
Hello
How do I use the above function:byebye:

how to convert date type?
Posted: Tue May 29, 2012 5:53 am
by Alex K.
Hello,
You can use the following expression:
Thank you.
Re: how to convert date type?
Posted: Mon May 18, 2015 7:18 am
by a.ebbini
Is there a generic solution for this issue i have a system that display in Gregorian and i want to add to a generic option to display in hijri without going to every report in the system. i have about 200 reports.
Re: how to convert date type?
Posted: Mon May 18, 2015 8:11 am
by a.ebbini
Hello,
I found a solution to convert culture before render
Dim C As New Globalization.CultureInfo("ar-SA")
Dim TheCalendar As New System.Globalization.HijriCalendar
C.DateTimeFormat.Calendar = TheCalendar
Threading.Thread.CurrentThread.CurrentCulture = C
Report.Render
'Then return original culture
Re: how to convert date type?
Posted: Tue May 19, 2015 12:15 pm
by Alex K.
Hello,
Ok.
Let us know if you need any additional help.
Thank you.