Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula value is not clearing ? Post Reply Post New Topic
Author Message
umesh.chape
Newbie
Newbie


Joined: 12 May 2011
Online Status: Offline
Posts: 11
Quote umesh.chape Replybullet Topic: Formula value is not clearing ?
     Posted: 23 May 2011 at 8:43pm
Hi All,

I created one formula .It return the string . But every time it concatenate the new value with old value .

e.g. instead of ABC, XYZ ,PQR it return like ABC,ABC XYZ,ABC XYZ PQR .

Formula is like this :

numberVar i=0;
numberVar strLen:=0;
strLen:=Length({tbDocumentDetailsIndia.Nationality}) ;
StringVar Array x;
stringVar strNationality ="";
stringVar array strSplited:= "";
strSplited:= Split ({tbDocumentDetailsIndia.Nationality}," " );
for i:=1 To strLen Do
(
   
           if{tbDocumentDetailsIndia.Nationality}<>" " then

           strNationality := strNationality + " " + {tbDocumentDetailsIndia.Nationality} + " "
        else
           strNationality := strNationality + "   " + Trim ({tbDocumentDetailsIndia.Nationality})

);

strNationality;
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 May 2011 at 3:41am
I would either compare with isnull or finding length of variable; I usually use latter.

Also, you are splitting the Nationality with strSplited. you should be referencing this within your function.




IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum