428,978 Members | 1,467 Online
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

# split function in crystal report

 100+ P: 232 i have to split adress like raj,2d-raja road,delhi-10008. to raj, raja road, delhi-10008. i can do it with split function but its giving error msg Expand|Select|Wrap|Line Numbers Dim x(3) As String x = Split ({std.addr}, ",") formula = x(2) If Isnull({std.a}) or ({std.b})= "" then    {std.addr}     else     {std.prj}+", "+{std.addr} when i use it in formulae error is remaining text doesnot appear to b part of formula plz help me by giving example Nov 20 '08 #1
10 Replies

 Expert 100+ P: 1,445 Hi, just change your formula to : Expand|Select|Wrap|Line Numbers   Dim x(3) As String x = Split ({std.addr}, ",") x(2)   Return x(2), Instead of assigning it to the formula.. Regards Veena Nov 20 '08 #2

 100+ P: 232 Hi, just change your formula to : Expand|Select|Wrap|Line Numbers   Dim x(3) As String x = Split ({std.addr}, ",") x(2)   Return x(2), Instead of assigning it to the formula.. Regards Veena no its still giving same error Nov 20 '08 #3

 Expert 100+ P: 1,445 Hi, What is version of your CR...? Nov 20 '08 #4

 Expert 100+ P: 1,445 Hi, I Guess, CR9 and above support Split Function.. Also Change your Formula To : Expand|Select|Wrap|Line Numbers whileprintingrecords; Stringvar array MyAddr:=split({MyTable.MyField},","); If Len(MyAddr) >= 2 Then MyAddr[2] Else ' ' ;   Regards Veena Nov 20 '08 #5

 100+ P: 232 Hi, I Guess, CR9 and above support Split Function.. Also Change your Formula To : Expand|Select|Wrap|Line Numbers whileprintingrecords; Stringvar array MyAddr:=split({MyTable.MyField},","); If Len(MyAddr) >= 2 Then MyAddr[2] Else ' ' ;   Regards Veena thanx its cr 9 whileprintingrecords; Stringvar array MyAddr:=split({std.addr},","); If (count(MyAddr) >=4) Then MyAddr[1]+ MyAddr[2] problem is that second array is printing in same line i want to print in second line is there any newline formula in crystal report??? thax again for your support Nov 20 '08 #6

 Expert 100+ P: 1,445 Hi, I Guess, Any of these should work.. MyAddr[1] + Chr(13) + MyAddr[2] OR MyAddr[1] + Chr(10)+Chr(13) + MyAddr[2] OR MyAddr[1] + Chr(10) + MyAddr[2] Also, you need to Format the FormulaField to Print on Multiple Lines.. Check the "Can Grow" option.. Regards Veena Nov 20 '08 #7

 100+ P: 232 thax but when i use char(10) or char(13) it gives some space with new line like a-13 sarojini nagar, new delhi-11002. i dont want space in second line and in other remaining lines Nov 20 '08 #8

 Expert 100+ P: 1,445 Hi, Chr(13) should work.. Did you format the FormulaField with "Can grow" option..? also adjust the physical width of the Formula field.. Regards Veena Nov 20 '08 #9

 100+ P: 232 sorry but previous example i given was not right its like i adjusted formating grow option its like Expand|Select|Wrap|Line Numbers a-13 sarojini nagar,   raj nagar   new delhi-11002. i want r of raj nagar right bekow a Nov 20 '08 #10

 Expert 100+ P: 1,445 Hi, Try Combination of Chr(13) & Chr(10) (in the same order) Regards Veena Nov 21 '08 #11