Jump to content

How to create a "Top N" report?


jleyser

Recommended Posts

 I'm an experience Crystal Reports user, now learning iReports.

Using grouping a sorting, I can print a 'rank' for each group, such as showing revenue per customer, using Grouping and the Group Footer Band.  Works great.  And, since it's part of the data source, I can sort the list on Customer Name.  So far, so good.

But what I really want to do is sort on the 'rank', which is being computed at report time.  So, instead of this:

customer-1 $1,000 total sales

customer-2 $2,500 total sales

customer-3 $1,500 total sales

I want:

customer-2 $2,500 total sales

customer-3 $1,500 total sales

customer-1 $1,000 total sales

Is that possible?  If so, how?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I think that a variable computed for each row coming from db can't be used to order the final result set...


this because it seems to be a big cicle fetching the dataset... so if this variable is computed at time the data was retrieved, then the previous data are already computed



maybe you can emulate this variable at DB level when you select the data... passing it a s a field, and using it to order the data.


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...