Jump to content
We've recently updated our Privacy Statement, available here ×

adding serial number to rows of data or result


rajuchacha007

Recommended Posts

Hi experts,

I have generated a report using ireport and I am exporting it through java as well. I wanted to order the data according to some other field rather than id or serial number. Therefore, I have removed id/serial number from the query and I am getting desirable reults. Now I want to keep serial numbers to this set of data. How should I achieve it? Do I need to add any field? or anything else. I will elaborate what I do need exactly. Assume I have a query like this,

select employeeNumber,employeeName,employeeCity from emloyee                     following is the result

ID          Name        City

1           ABC            NEW YORK

2           PQR           LONDON

3           XYZ             PARIS............................Now to get it ordered by city I changed query to

select employeeNumber,employeeName,employeeCity from emloyee order by emplyeeCity.......and i get like this

ID        Name         City

2          PQR           LONDON

1          ABC            NEW YORK        

3           XYZ             PARIS.........................................I want to get IDs in sequence so I removed ID from query

select employeeName,employeeCity from emloyee order by emplyeeCity

PQR           LONDON

ABC            NEW YORK        

XYZ             PARIS

Now I want these ID in sequence. like following

ID        Name         City

1          PQR           LONDON

2          ABC            NEW YORK        

3           XYZ             PARIS

 What can I do to achieve in the ireport? I tried by adding an extra field in fields category but this didn't work. Do I need to write any expression for this? I would welcome your help,ideas and suggestions. Thanks in advance.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

try to use:
 

a textfiled (type INTEGER)  with predefined variable $V{REPORT_COUNT} for counting rows in report, or

a textfiled (type INTEGER)  with predefined variable $V{PAGE_COUNT} for counting rows per page...

 

 

____________________________________
if it works... give me KARMA points please!    : ) 
____________________________________
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...