how to return numbers for each row in my report 1,2,3

  • I want to return numbers 1,2,3... for each row

     in my reports when its returned e.g

    I want my report to have numbers listed against each row

    1. boy

    2. cat

    I looked at the Globals but i can't see anything to use..

    Any ideas??

    Sure it must be easy..

    Thanks in Advance

  • Use the following expression in the column and detail row of your table that you want the numbers to appear in:

    =RowNumber(Nothing)

    This will generate the numbers for you

  • I tried that actually earlier but its given me some random numbers..

    like

    1.look

    16.Boy

    39.Cool

    Is this because i'm GROUPING?

    Thanks in Advance

  • Yes the grouping is causing it, have you tried generating numbers using a stored proc for the dataset of the report?

    Somthing like this will generate numbers in the Grouping sequence:

    create table Animal (Animal_ID int NOT NULL ,

    Animal_Name varchar (50) NULL ,

    Animal_Type varchar (50) NULL ,) on primary

    go

    insert into Animal values (1,'George1','Cat')

    insert into Animal values (2,'George2','Dog')

    insert into Animal values (3,'George3','Dog')

    insert into Animal values (4,'George4','Bird')

    insert into Animal values (5,'George5','Bird')

    insert into Animal values (6,'George6','Lizard')

    insert into Animal values (7,'George7','Lizard')

    insert into Animal values (8,'George8','Snake')

    insert into Animal values (9,'George9','Snake')

    insert into Animal values (10,'George10','Snake')

    insert into Animal values (11,'George11','Cat')

    go

    select (select count(distinct Animal_Type) from Animal)-

    (select count(distinct Animal_Type) from Animal b where b.Animal_Type > a.Animal_Type) as GroupNumber,

    Animal_Type, Animal_Name

    from Animal a

    order by Animal_Type

  • Thanks guys i ended up using RunningValue:-

    http://msdn2.microsoft.com/en-us/library/ms159136.aspx

    And it worked like a charm

    PAtrick

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply