Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Arrays in Loop Post Reply Post New Topic
Author Message
ashfaq
Newbie
Newbie


Joined: 16 Mar 2010
Location: India
Online Status: Offline
Posts: 10
Quote ashfaq Replybullet Topic: Arrays in Loop
    Posted: 17 Mar 2010 at 8:20pm
Hi,
I am trying this in many ways but i can't get it.
I am having array which conatain ten values like 10,20,30,40,50,60,70,80,90,100
 
I want to print this in below format.
10
20
30
40
50
60
70
80
90
100
Can any one help me to out this problem.
Thank you so much for your help
IP IP Logged
razzak
Newbie
Newbie
Avatar

Joined: 03 Mar 2010
Location: India
Online Status: Offline
Posts: 34
Quote razzak Replybullet Posted: 17 Mar 2010 at 10:47pm
This link may help you...
 
 
Razzak Sayyed
IP IP Logged
ashfaq
Newbie
Newbie


Joined: 16 Mar 2010
Location: India
Online Status: Offline
Posts: 10
Quote ashfaq Replybullet Posted: 18 Mar 2010 at 3:14am
Hi Razzak,
Thanks For your reply.
Since i am new to Crystal report, i am not able to get the things that would need to me on given link.
Actually i want to store the table field called as empDEPTID value in to an array. then i want to display this on the report.
I am trying to resolve this in many methods and also searching the web but i can not get what i need.
Thanks in advance for your valuable help
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 22 Mar 2010 at 9:15am
Something like this might work??

Starting with sample data

field - Value
10,20,30,40,50,60,70,80,90,100
40,20,30,40,50,60,70,80,90,100
50,20,30,40,50,60,70,80,90,100

the following formula was able to return the values in the format

10
20
30
40
50
60
70
80
90
100

********************************
stringvar output;
output :="";
numbervar i;
For i := 1 to count(split({Sheet1_.Value},",",1)) do
    (
     if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[1] +chr(13);

     if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[2] +chr(13);

if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[3] +chr(13);

if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[4] +chr(13);
if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[5] +chr(13);

if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[6] +chr(13);

if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[7] +chr(13);

if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[8] +chr(13);
if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[9] +chr(13);
if split({Sheet1_.Value},",") <>" " then
     output := output + (split({Sheet1_.Value},","))[10] +chr(13);
     
);
output

********************************

this formula will only work if there are a consistent number of items in the array

Hope this helps
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.017 seconds.