Sunday, March 16, 2014

Split String in Crystal Report Using Formula using any character (|,,<,>)

Unformatted String stored in database:
CustomerID:1020 |type:Current|City:Karachi|Country:Pakistan
The code should be written inside the formulae editor
 Create a new formula name it whatever you like 
e.g @formatString 
formulae field to display  the formatted string after splitting is given below:


stringVar array stringArray := split({Tablename.toFormatedField},"|");
Local numberVar i;
Local stringVar outputFormattedString := ""; 

For i:=1 to Count(stringArray) do(

outputFormattedString := outputFormattedString + stringArray[i] + Chr(10)

);
outputFormattedString
The outputString is :
CustomerID:1020
type:Current
City:Karachi
Country:Pakistan

1 comment:

Postman beginner Tutorial

Hi , I have started new video series of postman tutorial hope it will be helpful:Please give me your feed back in comments and like and sub...