Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Topic: Creating a variable Posted: 05 Feb 2008 at 2:49pm
In my report I need a column that will populate the numbers from 1 to number of records in my report. eg
no empno ename
1 3155 Matt
2 3344 kathy
3 8890 Piyush
4 8908 Ram
5 0098 Ann
6 9876 Christina
The database does not have a field "no" but has fields "empno", and "ename". I need to have a field "no"
I created a formula
whilereadingrecords;
Global numbervar y;
y := y + 1
When I do not have any groups, it works fine after I put the formula in
the detail section. But after I insert groups, It does not work.
I have 2 groups and I have to hide the first group and hide the details section.
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Posted: 06 Feb 2008 at 5:20am
Incidentally, you may also be able to use the RecordNumber function. This just gives the sequential number of the record. Of course, given your requirement for suppressing the first group, that may not work for you.
Can you be a little more specific in how it "does not work?"
Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Posted: 06 Feb 2008 at 8:17am
When I put the variable in the details section It works just fine without changing the formula. The no. field (please see the initial post for column names) is sequential 1,2,3, 4, 5, 6 and so on. But when I have to suppress the details section and put the field in group header, the sequence is 1,16,18,24,28,30,35 which should be 1,2,3,4,5,6,7 and so on.
My variable should be in group header because I am using summary functions and all the data should be displayed in the group header( That is why I have all objects in group header).
I tried using the recordnumber function but it has the same problem.
I tried Rahul's formula. It worked fine after I put that in the group header section.
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