cancel
Showing results for 
Search instead for 
Did you mean: 

Record Number Groupwise

former_member458725
Active Participant
0 Kudos

Hi,

          I have three grouping in crystal report. I need to set the record number as follows

          1.Level One

               1.1 LevelOne Sub level One

                    1.1.1     AAAAA

                     1.1.2    XXXXXX

               1.2  LevelOne Sub level Two

                    1.2.1       BBBBB          

                    1.2.2       CCCCC

                     1.2.3     DDDDD

          2. LevelTwo

                2.1 LevelTwo Sub level One

                    2.1.1   ZZZZ

               2.2 LevelTwoSub level Two

How can i achieve this in report.

Thank you

Vibin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You just need to increment the number variables at the required group headers and use them under their sub groups.

Then reset variables used in the subgroups in the outer-main group footers.

for e.g the formula to be placed in group header of group # 1 will be:

numbervar x:=x+1;

then, in group header of group # 2, it will be

numbervar x;

numbervar y:= y+1

totext(x,0,"") + '.'+ totext(y,0,"")

and, in the group # 3, it will be

numbervar x;

numbervar y;

numbervar z:=z+1;

totext(x,0,"") + '.' +totext(y,0,"") + '.' + totext(z,0,"")

Now, you'd also need to reset variables y and z at group footer # 1 and 2 respectively.

numbervar y:=0   //place in group footer # 1 section

numbervar z:=0 //place in group footer # 2 section

Prathamesh

former_member458725
Active Participant
0 Kudos

Hi,

     I tried your code, but the series 1.1 is  repeated. Its not showing 1.2, also in the third group 1.1.1 is repeated ,its also not incremented to 1.1.2, 1.1.3 .....

I one more thing, how can i bring a, b, c... on the fourth group..???

Former Member
0 Kudos

Can you post a snapshot of where and how you placed the formulas on the report canvas.

Also, let whileprintingrecords be the first line of code in each of the formulas.

To show a,b,c in the 4th group, the groupnumber special field will be helpful.

Obviously some hardcoding will be required since its not a number series.

for e.g. create a formula called ShowAlphabets > place it at group header # 4 and suppress it.

whileprintingrecords;

numbervar getNum:=groupnumber;

if getNum=1 then "a"

else if getNum=2 then "b"

else if getnum=3 then "c"

else if .....

..

..

Then, in the formula used for showing group series numbers(placed on group header # 4):

whileprintingrecords;

numbervar x;

numbervar y;

numbervar z;

totext(x,0,"") + '.'+ totext(y,0,"") + '.' + totext(z,0,"") + '.' + @ShowAlphabets


Prathamesh

former_member458725
Active Participant
0 Kudos

Hi,

     I figure that out, In your previous comment you were missing "Whileprintrecord".I also changed the reset filed to the header iteself, now working fine.  And i had found the new formula, I think better than you just mentioned above. See below code


global numbervar i;

WhilePrintingRecords;

global numbervar i:=i+1;

chrw(96 + i)

Thanks

Former Member
0 Kudos

Thanks Vibin, please close this thread if the requirement is achieved.

Prathamesh

Answers (0)