How to generate an index for array result in reports

Hi,

I was wondering how I can generate an index for the items in the results of a query. so for example I have and list of order lines in an order when I want to generate a report I want the item index for every line just as shown below in bold.

1 name price
2 name price
3 name price

Thanks,
Mohamed

Hi,
Which database and which sort of report band do you use?

Examples for SQL band and postgres:
https://www.google.com/search?q=postgres+row+number

Hi,

I use postgres with JPQL dataset.

Thanks,
Mohamed

I think obtaining row number is not possible with JPQL.

It would be easier for you to rewrite dataset to SQL and use full power of SQL there.

Hi,

Can you assist me in converting to native sql

select
product.name as "product.name",
e.amount as "amount",
e.price as "price",
e.amount * e.price as "sum"
from salesman$SaleProduct e  
left join e.product product 
 where e.sale.id = ${sale}

Thanks,
Mohamed

Hi,

No worries got it working thanks for your help.

Thanks,
Mohamed