Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do Loop in Version 7

Status
Not open for further replies.

jdemmi

MIS
Jun 6, 2001
1,106
US
Can anyone tell me if the "DO LOOP" function exists in version 7?

Examples:

Do while variable > 0
bla bla bla
Loop

Do
bla bla bla
while variable > 0
 
No, this functionality did not exist until v8 and higher. Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Thanks.....you confirmed my assumption
 
depending on what you want to do...you may be able to create a subreport to do the work of a do-loop as a work around.....just a thought Jim Broadbent
 
The way to emulate a do loop in CR7 is as follows where you want to build a list of values from a multivalue parameter.

Stringvar s:=""

if count({?parm}) >=1 then s:=s + ", " + {?parm} [1];
if count({?parm}) >=2 then s:=s + ", " + {?parm} [2];
if count({?parm}) >=3 then s:=s + ", " + {?parm} [3];
if count({?parm}) >=4 then s:=s + ", " + {?parm} [4];
if count({?parm}) >=5 then s:=s + ", " + {?parm} [5];
if count({?parm}) >=6 then s:=s + ", " + {?parm} [6];
// how many lines can you cut and paste in here
mid (s,3) // to remove the first comma and space

The only unpleasant thing is you need to code each pass of the loop, but if there aren't too many it can work well.

Good luck


Editor and Publisher of Crystal Clear
 
Thanks everyone, I found documentation which leads me to believe that in Maintenance Release 1 (MR1) of Crystal 7, this function is supported. I have since ordered MR1.

Just as a note, the problem I was having was:

I have a report with a parameter called location. I am allowing users to select multiple locations. I wanted all locations selected listed on the report header. By default Crystal only displays the first location selected. I have a Do LOOP formula which works in 8, but the application I am integrating this report with currently only supports 7. :-(

Thanks again!
 
A subreport can accomplish this task

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top