how to convert date type?
-
- Posts: 4
- Joined: Thu Sep 01, 2011 10:50 am
how to convert date type?
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.
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?
Hello.
Thank you.
You can write your function on the Code tab in the begin of report, for example: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.
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();
}
-
- Posts: 4
- Joined: Thu Sep 01, 2011 10:50 am
how to convert date type?
thank you
how to convert date type?
Hello,
Let us know if you have additional questions.
Thank you.
Let us know if you have additional questions.
Thank you.
-
- Posts: 1
- Joined: Mon May 28, 2012 5:48 pm
- Location: iran
how to convert date type?
Hello,
You can use the following expression:
Thank you.
You can use the following expression:
Code: Select all
{DateToHijri(B_Topics.Date)}
Re: how to convert date type?
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?
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
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?
Hello,
Ok.
Let us know if you need any additional help.
Thank you.
Ok.
Let us know if you need any additional help.
Thank you.