Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to reset array to start fresh for each group Post Reply Post New Topic
Author Message
RoadRunner
Newbie
Newbie
Avatar

Joined: 06 Aug 2014
Online Status: Offline
Posts: 8
Quote RoadRunner Replybullet Topic: How to reset array to start fresh for each group
     Posted: 08 Jul 2015 at 4:42am
Hi

I have data grouped by client type. I have crated an array to gather the countries represented by each client in the group but I am having problems resetting the array to start for the next group.

Formula 1. in the details section

Whileprintingrecords;
Stringvar array dep;
numbervar i;
if not ({info_countriesFrom.country_name} in dep) then
(
i:= i+1;
redim preserve dep;
dep:= {i.country_name};
);
dep

Formula 2. In group footer
Whileprintingrecords;
Stringvar array dep;
Stringvar fin;
Numbervar j;
For j:= 1 to ubound(dep) do
fin:=fin + dep[j] + ",";
left(fin, len(fin)+2);

How do I reset the array 'dep' to start again for the next group?

Any help would be most appreciated.
Thank You!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jul 2015 at 5:11am
3rd formula in a gh setting it to ""
IP IP Logged
RoadRunner
Newbie
Newbie
Avatar

Joined: 06 Aug 2014
Online Status: Offline
Posts: 8
Quote RoadRunner Replybullet Posted: 08 Jul 2015 at 5:19am
I used this formula to try and reset it but it does not seem to work.

whileprintingrecords;
stringvar array dep;
Redim dep[1];
" "
Thank You!
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