This is a migrated thread and some comments may be shown as answers.

Expression to convert integer to month name

3 Answers 280 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Deepesh
Top achievements
Rank 1
Deepesh asked on 11 May 2011, 05:45 AM
Hi all,
I'm getting a value from a query which is an integer that represents a month. How would I convert this integer to an actual month name for displaying in the report? Is there any specific expression or function to be used as I can't seem to find any?

Thanks,
DK..

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 13 May 2011, 05:46 PM
Hi Deepesh,

You can easily convert an integer value to a month name with the following User Function:

public static object GetMonth(int value)
{
    return System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(value);
}
Once you add the user function and rebuild your project it will appear in the Report Designer's Edit Expression Dialog.

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rattapol
Top achievements
Rank 1
answered on 06 Jan 2017, 07:09 AM

Hi All

I have same problem with Deepesh but i only have Telerik Report Designer. i want to know how to add function 

0
Stef
Telerik team
answered on 06 Jan 2017, 01:22 PM
Hello Rattapol,

Please check Extending Report Designer and the linked resources at the bottom of the help article. These tutorials will help you load the custom function in the Standalone Report Designer, and in the application with the viewer displaying reports.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Deepesh
Top achievements
Rank 1
Answers by
Peter
Telerik team
Rattapol
Top achievements
Rank 1
Stef
Telerik team
Share this question
or