Display the current row number in a table

Top Previous Topic Next Topic  Print this topic

Synopsis:

 

Most of the times it is very useful to display the current row number in a table. How can you do that using XF Designer 2011?

 

Answer:

 

You can do that using a predefined function: position() which returns the position of the node in a nodes list.

 

Insert a new column in the table you want this option for. In this example we created the table by drag and dropping ns:cd node from the Data Source dialog bar and selecting Repeating Table. You can insert the current position in any place you want in the table but usually it is used a column in the left side of the table.

Place the cursor into the new column and go to Insert menu and choose Field.

The Edit Expression dialog will be displayed. Select from the list of functions the one you need, that is position() from Nod-Set functions, and click OK.

 

current_position3

 

The pictures below display the result of these actions:

 

Design View:

 

current_position

 

PDF result:

 

current_position2