Limit the number of records per page

Use this procedure to limit the number of records shown on pages of a report.

This procedure demonstrates how the number of records shown in a report can be limited by means of conditional formatting. In particular, a formatting rule is applied to the Visible property of the Page Break control. In this example, the number of data rows is passed to the report as a parameter.

For details, see Report controls.

  1. Create a new report or open an existing one.

    In this procedure, a table report is used as a starting point.

    Limit number of records
  2. To add a parameter to the report, in the Field List, right-click the Parameters section, and click Add Parameter.
  3. For the new parameter, set property values as follows:
    PropertyValue
    (Name) rowsNumber
    Parameter Type Int32
    Description Rows per Page:
  4. From the Tool Box, drag the Page Break control onto the report's Detail band at the top of the detail table.
    Limit number or records

    For details, see Report bands.

  5. For the new control, set the Visible property to No, and click the browse button (...) in the Formatting Rules property box to open the Formatting Rule Editor dialog box.
  6. Click the Edit Rule Sheet button to open the Formatting Rule Sheet Editor
  7. Click the add button (+), to create a new formatting rule.
  8. Set The new rules Visible property to Yes, and click the browse button (...) in the Condition property box to open the Condition Editor dialog box.
    Limit number or records
  9. In the Condition Editor dialog box, define the following expression for the rule:
    • ([DataSource.CurrentRowIndex] % [Parameters.rowsNumber] == 0) And ([DataSource.CurrentRowIndex] != 0)
  10. Click OK to save the changes and close the dialog box, and then click Close to close the Formatting Rule Sheet Editor.
  11. In the Formatting Rules Editor, first select the new rule in the Available Rules box, then click the > button to move it to the Applied Rules box.
  12. Click OK to close the Formatting Rules Editor dialog box.
  13. The report is now ready. Switch to the Preview tab, and in the Parameters section, define the required value, and click Submit.