Top-Ten Style Reports
Reports can be used to create fully functional Top-Ten lists, restricting output to a specified number of records sorted by your sequence key. While you can create a Top-Ten list for the detail level, this document will describe how to create a Top-Ten list based upon a Sub-total Level.
Experienced m-Power developers will recognize that the Top-Ten Style Report is similar to the standard Ranking Report template. For developers looking for a more hands-on approach, the Top-Ten Style Report offers a greater degree of flexibility and ease of use.
Setting up the report:
Build your report, making sure the “Summary or Detail” report is set to “Summary”. This will allow your page to print without showing the detail line by default. Also, keep in mind the field you sequence by will be the field that groups your top ten list. Build the application.
Specifying run time parameters:
To utilize a Top Ten style list, you must use URL parameters to bypass the prompt page and pull in the top ten records.
run=2 — This specifies that you intend to skip the prompt page, and go directly to the output page of the report.
cur_sort_col — This parameter controls the field you wish to sort your top ten list by. Substitute your field name for FIELDNAME.
sort_type — This parameter controls whether you want your list in ascending or descending order. “1” specifies a descending list whereas “0” specifies an ascending list.
top10 — This parameter controls how many records you wish to have in your top ten list.
The final URL will look similar to this example:
An example of a finished report:
Changing the parameters in the URL allows you to easily build a range of ad hoc reports based off of a single application. For instance, changing sort_type to equal “0” will sort the report in descending order. This allows you to easily switch between a Top-Ten Style list and a Bottom-Ten Style list.