Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Increment a column value by the parameter value Post Reply Post New Topic
Author Message
Provalian
Newbie
Newbie


Joined: 25 Nov 2014
Online Status: Offline
Posts: 1
Quote Provalian Replybullet Topic: Increment a column value by the parameter value
    Posted: 18 Feb 2021 at 3:51am
I have a column value that I want to increment by the parameter value and display the array

Column value = 45000
Parameter Value = 5

Report Result
45001
45002
45003
45004
45005

Can someone help with how to create this report?

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 18 Feb 2021 at 4:23am
Formula with a  FOR LOOP putting data into an ARRAY?  I do not remember the syntax. I can work on it in a bit.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 18 Feb 2021 at 4:58am
Here is some sample code.  I do not know if this what you need to achieve.  Of course a parameter will have to be created (I called mine counter),

numbervar array values;
redim values[{?counter}];
numbervar initial := 40000;
numbervar i;
stringvar resultstr;
i:= 1;


while i <= {?counter}
do
    (
        initial  := initial + 1;
        values := initial;
        
            i:= i +1
    );
i:= 1;
while i <= {?counter}
do
    (
      resultstr := resultstr + chr(13) + cstr(values);
        i := i +1;
    );
right(resultstr, len(resultstr) -1)
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.064 seconds.