Print Page | Close Window

Looping will not reset in Crystal 2008

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16240
Printed Date: 04 May 2024 at 1:51pm


Topic: Looping will not reset in Crystal 2008
Posted By: amanda5615
Subject: Looping will not reset in Crystal 2008
Date Posted: 20 Apr 2012 at 5:47am
Hello, I am having issues with my loop with an array not resetting:
 
whileprintingrecords;
numberVar Array WorkOrders:= mailto:%7b@Total - {@Total Workorders per account} ;
redim workorders[{@Total Workorders per account}];
numbervar counter;
stringvar ShowWorkorders;
for counter  :=  1 to Ubound (workorders)
Do(ShowWorkorders := showWorkorders +({vReport_workOrders_futureSMs_OASYS.workOrderID} + ', '));
showworkorders;
 
any tips?



Replies:
Posted By: lockwelle
Date Posted: 23 Apr 2012 at 4:50am
if you only need the array in this formula, add local to start...like:
local numbervar array WorkOrders...
 
I've heard that shared is the default condition, which would mean that it persists between calls to the formula.  I would have thought that the redim would clear it out to default values, but....
 
HTH
 
ps if you need the array in other places, you will need to create a reset function that will clear out the newly redimmed array.



Print Page | Close Window