Skip to main content

Limit the Number of Records per Page

This document describes how to specify the number of data source records displayed on report pages.

After you bind the report to data and populate the DetailBand with data-bound report controls, you can limit the number of records each report page displays. This example demonstrates how to pass the required record count as a parameter value in Print Preview.

  1. Switch to the Field List, right-click the Parameters section, and add a new report parameter.

    field-list-add-parameter

  2. Specify parameter settings in the Report Parameters Editor window. Set the Name to “rowsPerPage”, Type to Number (16 bit integer), Description to the “The number of data rows per page” string, and Default Value to 1.

    parameter-integer-rows-per-page

  3. Drop the XRPageBreak control onto the report’s detail band and click its f button.

    drop-page-break-control

    expressions-page-break-visible

  4. The f button invokes the Expression Editor where you can specify the following expression for the Visible property:

    ([DataSource.CurrentRowIndex] + 1) % ?parameter1 == 0 And ([DataSource.CurrentRowIndex] !=0)
    

    expressions-page-break

  5. Switch to Preview and enter the parameter value to specify the number of data rows per page:

    rows-per-page-preview-result