In a Section report, in order to display only the top N number of rows or records on a report, you can manipulate the data in query, or use script depending on the data source. Let's see the working example for a report bound to an Sqlite data source. Your data will be more meaningful if you also specify the order of rows.
Data Source Connection String |
Copy Code
|
---|---|
data source = C:\Data\reels.db |
Query |
Copy Code
|
---|---|
SELECT * FROM Movie Order By UserRating Desc LIMIT 10 |
The following sections provide sample queries or script that must be used to obtain top N data for other data sources.
Query |
Copy Code
|
---|---|
SELECT Top 10 * FROM Movie |
Query |
Copy Code
|
---|---|
//countries/country[position() <= 10]
|
Query |
Copy Code
|
---|---|
$.Customers[:10] |
Script |
Copy Code
|
---|---|
int i = 1; public bool ActiveReport_FetchData(bool eof) { return i++ > 10; } public void ActiveReport_ReportEnd() { i = 0; } |