Muhammad Gulfam
Muhammad Gulfam

Reputation: 255

Custom Function addition in crystal Report

I have to format a date string to a custom format like i need to convert "11/04/2016" to "11/D/2016". simply I have to replace the month number that is here 04 to an alphabet with the same sequence like 01 will be replaced by A and 02 by B and so on. I don't have any problem for writing logic for general purpose programming language. But I dont know how to add this custom functionality in crystal report. I have checked formula fields but it seems they have predefined formulas whereas I need custom formula. Is there any way to add custom function in crystal report and pass it some parameter and then it returns you come data that you show on the report ??? Thanks in advance !

Upvotes: 2

Views: 9767

Answers (1)

Siva
Siva

Reputation: 9101

Go to Report --> formula workshop and there go to New and there select custom function

Syntax would be:

Create a function Convert

Function(StringVar value) //this will take the input string

//Here write your logic and return a value.and close the function

Now you have created a custom function.

To use this create a new formula in functions go to custom functions and double click already create function

Convert("11/04/2016"); //close the window and place formula on design and refresh you get required output

Upvotes: 3

Related Questions