Discussion
STC
IN
Last activity: 4 Feb 2026 4:40 EST
Customizing Max Record Count in Pega Report Definitions
In Pega Report Definitions, we usually control the number of records using Max Records in the Data Access tab.
However, when a value is hard-coded there, the report always executes with the same record limit, which restricts flexibility.
Problem
-
Max Records defined in the Report Definition is static
-
The report is always invoked with that count
-
Dynamic use cases (pagination, batch processing, email digests, APIs) become difficult
Recommended Approach: Dynamic Record Count via Activity
Instead of defining Max Records in the Report Definition, we can control it dynamically at runtime using an Activity and ReportParameters.
Step-by-Step Implementation
Step 1: Remove Static Max Records
-
Open the Report Definition
-
Clear the Max Records value in the Data Access tab
Step 2: Create an Activity
Create a reusable activity to invoke the Report Definition dynamically.
Step 3: Page-New
-
Step:
Page-New -
Page Name:
ReportParameters -
Class:
Embed-QueryInputs
Important: Make sure this page is also declared in the Pages & Classes tab.
Step 4: Property-Set
Set the required Report Definition properties dynamically.
Step Page: ReportParameters
Set the following properties:
Param.pyReportName = <Report Definition Name> Param.pyReportClass = <Applies-To Class> Param.pyPageName = <Output Page Name> Param.pyReportParamPageName = ReportParameters .pyMaxRecords = <Desired Record Count>
.pyMaxRecords controls how many records the report retrieves at runtime [It can be from DSS too ].
Step 5: Call Report Definition
-
Use Call → Report Definition
-
The report will now execute using the dynamic Max Records you provided
Key Benefits
-
Dynamic control over report execution
-
Cleaner and reusable design
-
Ideal for email digests, dashboards, integrations, and batch jobs
-
Aligns with Pega best practices
Reference (OOTB Example)
To understand how Pega uses this pattern internally, refer to the OOTB activity:
Activity Name: pzSendEmailDigest
This activity demonstrates how ReportParameters and dynamic record limits are applied effectively.