stringvar x := {myfield};
Local numbervar i;
local stringvar array AllPoints := split(x,"<br/>");
local stringvar results :="";
for i := 1 to count(AllPoints) do (
Results := Results &
ToText(i,0,"") + ". " + AllPoints+chr(13)
);
Results
data:
Avai on a mo.<br />Incls Lel tions as ayed at Dn Sio.<br /><br />This option le at gn So only.<br />Must be ped for each ly and all va cabt mach.
in your data there is a space i didnt see before and didnt account for ... also... there is an additional <br /> which i didnt know was there and didnt account for so use this code with two changes ...
1 - I replaced <br /><br /> with <br /> so that the split function would not add a blank number (unless thats what you wanted)
2 - added a space in <br />.. i had it as <br/>
stringvar x := replace({myfield},"<br /><br />","<br />");
Local numbervar i;
local stringvar array AllPoints := split(x,"<br />");
local stringvar results :="";
for i := 1 to count(AllPoints) do (
Results := Results &
ToText(i,0,"") + ". " + AllPoints+chr(13)
);
Results
please copy that exatly with no changes and let me know if you get the desired results
_____________________________________ Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection
Now it is coming something weird. For some only "1." and for some 1,2,1,2,1,2...
Thanks for all the help CoSringsGuy, seems this is something i need to talk to db people and ask them to validate the data. Even I was spending too much time to figure out this, but doesn't seems logic problem.
Why are you using <br/>? What results do you get with the following? It works for me.
stringvar x := {yourfield};
Local numbervar i;
local stringvar array AllPoints := split(x,".");
local stringvar results :="";
for i := 1 to count(AllPoints) do (
Results := Results &
ToText(i,0,"") + ". " + AllPoints+chr(13)
);
if right(x,1)='.' then
left(Results, len(results)-len(totext(i,0,"")+'.')-2) else
Results;
you know there will be crystal built in special fields like date time, page number etc. similarly there is one called 'record number'.
i created a formula in basic syntax (not crystal syntax) in the formula editor as:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.