How to Generate Serial Numbers Automatically in Reports AX 2009?


I want to generate SNO Automatically in Reports.


In SalesOrder I am picking Items.

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

S.No ItemName Qty Price

1 TV 2 10000




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



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.

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.



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;

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()

return i;

It will give you desired result.

Hi Naresh,

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



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

thanks in advance