on 12-09-2013 1:01 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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 Prathamesh Acharya
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.