Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How do one create a Top (or Bottom)-N Report?

edited June 2002 in General
How would I go about creating a Top-N report, such as "show me the top 10
sales people", ect.? (I actually need a Bottom-N report.)


-Andreas

Comments

  • edited June 2002
    Do it on the dataset. Show a simple dialog before you print the report to
    ask the user to see a Top or Bottom N report. Depending on which database
    you have, there are different functions to facilitate this. You'll have to
    check you database's documentation to find out what the function is (if one
    exists). For example, in SQL Server, you can say SELECT TOP 10 ...

    If you're databse doesn't support this kind of aggregate function to limit
    the data, then you can also limit the data by using the DataPipeline
    properties to set the range to only return the first 10 records. You'll have
    to order the data by the field that you want the Top or Bottom N to be. You
    can also traverse the data pipeline from first to last or last to first.
    Please see the installed demos in the main 1. Reports demo project for an
    example of data traversal settings.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.