Limit the Number of Records per Page

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

Note

You can use this approach to limiting the number of data records per page when the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Expressions or DataBindingMode.ExpressionsAdvanced.

See Limit the Number of Records per Page to learn about the legacy approach to solving this task.

See Data Binding Modes to learn more about available binding modes .

After you bind your report to data and provide content to the report's detail band, 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..

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

    field-list-add-parameter

  • Specify the parameter's description displayed in Print Preview and set its type to Number (Integer).

    parameter-integer-rows-per-page

  • Drop an XRPageBreak control onto the report's detail band and switch to the Visual Studio property grid. Switch to its Expressions section and click the Visible property's ellipsis button (you can find it under the BeforePrint event's category if you are using the ExpressionsAdvanced binding mode).

    expressions-page-break-visible

  • This invokes the Expression Editor where you can specify the required expression.

    expressions-page-break

    For example:

    ([DataSource.CurrentRowIndex] % [Parameters.parameter1] == 0) And ([DataSource.CurrentRowIndex] !=0)

When switching to Print Preview, you can specify how many rows each report page should display by entering the corresponding parameter value:

rows-per-page-preview-result