I have successfully achieved the desired results for the first page. However, I am struggling with implementing the pagination logic from the second page onwards. Specifically, I need guidance on how to correctly paginate the remaining records across subsequent pages.
I am working on an SSRS report where I need to implement a specific pagination logic and am seeking guidance on the approach I’ve taken.
Requirements:
- Pagination and Row Limits:
- The first page should always print exactly 5 records.
- The second page (and subsequent pages, if necessary) should print up to 12 records per page.
- Example: If there are 20 data rows, the first page should contain the first 5 rows, and the second page should contain rows 6 through 17.
- Dynamic Item Count:
- The number of items is unknown during production. The report needs to dynamically adjust the page numbers and row counts according to the item count.
- If the item count is 5 or fewer, only the first page should be printed.
Report Structure:
I’ve divided the report into two main sections:
Section 1 contains four subreports:
-Subreport 1: Details (always on the first page).
-Subreports 2 & 3: Item details (continued on the second page if the item count exceeds 5).
-Subreport 4: Payment details (always on the first page).
Section 2 contains two subreports for item details.
-If the item count is exactly 5 or fewer, the second section should be hidden, and only the first page should be printed. Below is the design:
overall design on the main report
Query:
Is this approach correct, or is there a more efficient way to achieve the desired outcome? I would appreciate any suggestions or best practices, especially for handling dynamic pagination and conditional visibility of sections based on the item count.
Expected Result:
The page should look like the below: Here we have 10 items
Page 1
Page 2
PTBN: Tools used : “SSRS” , “Visual studio” , “ODBC Connection ( PostgreSQL)”
Thank you in advance for your assistance!
Priyanka S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.