By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
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
  1. Dim x(3) As String
  2. x = Split ({std.addr}, ",")
  3. formula = x(2)
  4. If Isnull({std.a}) or ({std.b})= "" then
  5.    {std.addr}
  6.     else
  7.     {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
Share this Question
Share on Google+
10 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

just change your formula to :

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim x(3) As String
  3. x = Split ({std.addr}, ",")
  4. x(2)
  5.  

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
  1.  
  2. Dim x(3) As String
  3. x = Split ({std.addr}, ",")
  4. x(2)
  5.  

Return x(2), Instead of assigning it to the formula..

Regards
Veena
no its still giving same error
Nov 20 '08 #3

QVeen72
Expert 100+
P: 1,445
Hi,

What is version of your CR...?
Nov 20 '08 #4

QVeen72
Expert 100+
P: 1,445
Hi,

I Guess, CR9 and above support Split Function..
Also Change your Formula To :

Expand|Select|Wrap|Line Numbers
  1. whileprintingrecords;
  2. Stringvar array MyAddr:=split({MyTable.MyField},",");
  3. If Len(MyAddr) >= 2 Then
  4. MyAddr[2]
  5. Else
  6. ' ' ;
  7.  
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
  1. whileprintingrecords;
  2. Stringvar array MyAddr:=split({MyTable.MyField},",");
  3. If Len(MyAddr) >= 2 Then
  4. MyAddr[2]
  5. Else
  6. ' ' ;
  7.  
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

QVeen72
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

QVeen72
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
  1. a-13 sarojini nagar,
  2.   raj nagar
  3.   new delhi-11002.
i want r of raj nagar right bekow a
Nov 20 '08 #10

QVeen72
Expert 100+
P: 1,445
Hi,

Try Combination of
Chr(13) & Chr(10)

(in the same order)

Regards
Veena
Nov 21 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.