I have a question here...
It is unclear to me what you really want.
In my Customer table for each customer record I have two fields which hold 'first number' (eg 10001) and 'last number' (eg 10230). What I would like to be able to do (if it is possible!) is to print all the numbers between "first number" and "last number".
So for one record for a customer, you want to list all of the numbers between the first and last?....nothing else???
Why??? and in what format?...a comma delimited string of some sort?
Something like this? for say 10001 to 10026
10001,10002,10003,.....10025,10026
It can certainly be done...easily actually using arrays. What is the maximum spread between the numbers....what is the maximum size of an individual number?
let us say 999999 is the largest number.there would be 6 numeric characters + one character for the comma for a total of 7 chars...or in 254char this translates to 36 numbers per element in an array....there could be more if the numbers could be smaller.
So in your example of 10001 to 10230 you would require 230/36 about 7 array elements to do the job. A Question here is .....is this a hi spread or a low spread...or just a number tossed out of the blue?
So let us plan for 100 array elements for now
Your report would consist of 100 detail subsections...each with one of the Array elements in it in a formula that stretches the width of the page. Each detail section would have "suppress Blank Section" enabled
In the Group header for Customer ID? you would have the formula
//@Initialize
WhilePrintingRecords;
StringVar array numbers := ["","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","",""];
""; //this added to make the formula legal
In the first detail subsection (a) place the formula
//@createnumberlist ( Suppressed in Detail A)
WhilePrintingRecords;
StringVar array numbers;
NumberVar temp;
NumberVar Pointer := 1;
StringVar Warning := "";
booleanVar flag := False;
//I am assuming the "first/last numbers" are numeric
for temp := {table.FirstNumber} to {table.LastNumber} do
(
if length(numbers[Pointer]) < 240 then
numbers[Pointer] := numbers[Pointer] + totext(temp,0) + ","
else
(
Pointer := Pointer +1;
if Pointer > 100 then
(
flag := True;
Warning := "Data Missing...too many numbers to report";
)
else
numbers[Pointer] := numbers[Pointer] + totext(temp,0) + ",";
);
if flag then exit for;
);
//get rid of last comma
if Pointer > 100 then
numbers[100] := Left(numbers[100],length(numbers[100] - 1)
else
numbers[Pointer] := Left(numbers[Pointer],length(numbers[Pointer] - 1);
Now in Detail A you simply place the following formula
@displayNumber1
evaluateAfter({@createnumberlist})
StringVar array numbers;
numbers[1];
in Detail B a similar formula
@displayNumber2
WhilePrintingRecords;
StringVar array numbers;
numbers[2];
you would add 98 more formulas similar to the above.
Each formula would have its "can Grow" enabled....any of the section with array elements that are null (initialized that way) will be suppressed
In the Customer Group footer you would place the following formula
//@warning
whilePrintingRecords;
StringVar Warning;
Warning;
this will let you know if you have to do maintenance on your report to accomodate a larger number spread.
That is how you would do what you want....why you would want to do this is beyond me though
Jim Broadbent
The quality of the answer is directly proportional to the quality of the problem statement!