display name of the month
display name of the month
is there any function in report designer to convert the month into name?
ex.
3/3/2010.. into just march
or maybe i use query in sql to get the month only and then some function can convert 3 to march..
thanks..
ex.
3/3/2010.. into just march
or maybe i use query in sql to get the month only and then some function can convert 3 to march..
thanks..
display name of the month
how about if i want to make something like this:
1=January
2=February
.
.
.
12=December.
is it possible?
1=January
2=February
.
.
.
12=December.
is it possible?
display name of the month
Hello,
You can use following expression:
Also you can write your function on the Code tab in the begin of report, for example:
and then use this function in expressions, for example:
Thank you.
You can use following expression:
Code: Select all
{new DateTime(1, yourMonthNumber, 1).ToString("MMMM")}
Code: Select all
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;
namespace Reports
{
public class Report : Stimulsoft.Report.StiReport
{
public string NumberToMonthName(int number)
{
if (number == 1) return "January";
if (number == 2) return "February";
if (number == 3) return "March";
if (number == 4) return "April";
if (number == 5) return "May";
if (number == 6) return "June";
if (number == 7) return "July";
if (number == 8) return "August";
if (number == 9) return "September";
if (number == 10) return "October";
if (number == 11) return "November";
if (number == 12) return "December";
return "";
}
public Report()
{
this.InitializeComponent();
.....
Code: Select all
{NumberToMonthName(yourMonthNumber)}
- Attachments
-
- 406.Report months sample.zip
- (1.61 KiB) Downloaded 357 times
display name of the month
:biggrin: thanks a lot... really work..
display name of the month
Hello,
Perfect!
Thank you.
Perfect!
Thank you.