How to Generate Serial Numbers Automatically in Reports AX 2009?

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 6 Replies | 1 Follower

61 Posts
600 Points
Joined: 2012-9-25
Last Online:
2013-3-20 14:41
Balu posted on 2012-10-2 13:49

Hi,

I want to generate SNO  Automatically in Reports.

Ex:

In SalesOrder  I am picking Items.

Every Item takes 1,2,3... etc Sequential Numbers.

S.No      ItemName     Qty          Price

...................................................................

1            TV                    2              10000

2

3

4

 

Please Help Me how to generate these sequential numbers in Reports AX 2009.

 

Thanks,

Balu

Solution (Verified) Verified Solution

Male
363 Posts
7,570 Points
Joined: 2010-8-23
Last Online:
2013-5-13 15:08
Location: Bangalore,India
Verified by Balu

Hello Balu,

As said by Lalit it can be done by incremeting the variable in the fetch method and having the display method  which return the incremented value.

The other way is, just declare the variable in the class declaration, and have the same display method in the \Reports\Report1\Designs\ReportDesign1\AutoDesignSpecs\Body:\Methods - as

display int slno()
{

i++;
return i;
}

It will give you desired result.

 

 

 

 

 

All Replies

Male
171 Posts
1,830 Points
Joined: 2012-2-2
Last Online:
2013-5-22 0:54
Location: Ahmedabad , Gujarat
Lalit replied on 2012-10-3 6:35

hello Balu,

I think you must be running a loop for displaying items. In that loop only take an integer variable and increment the variable on loop ending .The variable will return accordingly to the number of items displayed and take a new field in the report which will show you the exact number of items.

With Regards :
LMJ

61 Posts
600 Points
Joined: 2012-9-25
Last Online:
2013-3-20 14:41
Balu replied on 2012-10-3 7:17

Hi Lalit.

Thanks for giving ur suggestion.  I dont know How to write display method for looping items. Can u help me how to write it.

 

Thanks,

Balu

Male
171 Posts
1,830 Points
Joined: 2012-2-2
Last Online:
2013-5-22 0:54
Location: Ahmedabad , Gujarat
Lalit replied on 2012-10-3 10:18

Hi Balu,

Initialize the variable in your fetch method of the report and increment that variable under your main loop of fetching items and write the display method as follows :

display int getNumber()
{
    ;
    return i;
}

With Regards :
LMJ

Male
363 Posts
7,570 Points
Joined: 2010-8-23
Last Online:
2013-5-13 15:08
Location: Bangalore,India
Verified by Balu

Hello Balu,

As said by Lalit it can be done by incremeting the variable in the fetch method and having the display method  which return the incremented value.

The other way is, just declare the variable in the class declaration, and have the same display method in the \Reports\Report1\Designs\ReportDesign1\AutoDesignSpecs\Body:\Methods - as

display int slno()
{

i++;
return i;
}

It will give you desired result.

 

 

 

 

 

61 Posts
600 Points
Joined: 2012-9-25
Last Online:
2013-3-20 14:41
Balu replied on 2012-10-4 10:07

Hi Naresh,

 

Thank u so much for ur suggestion. It is working fine.

 

Thanks,

Balu

5 Posts
45 Points
Joined: 2013-3-7
Last Online:
2013-3-20 13:21
Location: hyd and india
mohan replied on 2013-3-19 14:48

i had done the same but every time it is generating  1 waat to do help me

 

 

thanks in advance

Page 1 of 1 (7 items) | Get this RSS feed | Bookmark and Share