I have a Report which displays 6-groups(5-Rows in each Group) of information. The report is having some filter which can be modified by user. When first time report get loads without any filter its page rendering in report viewer and Print page is perfect, But when filters been added in Report information its get unusual.
Simple explanation given in below image:
Could anyone please suggest anything to fix number of rows/groups in each page?
I will provide two methods to solve the issue
I will assume that you are showing the report parameters (filters) as mentioned in the following link:
Then, you should set CanGrow
property to False
from the Textbox properties pane as mentioned in folowwing article:
Also make sure that Allow height to increase
property is not checked in the Text Box Properties Dialog Box
Helpful links:
While searching on this issue, i found the following solution which can be used as a workaround to distribute rows per pages:
You can specify the limit number of rows per page with a conditional approach. If it is the first page then 10
(2 groups) as example, and for other pages 15
(3 groups).
You should follow these steps:
Go to Report
>> Report Properties
>> Code
, in the Custom Code
section, enter the following:
Public Function PageNumber() as String
Dim str as String
str = Me.Report.Globals!PageNumber.ToString()
Return str
End Function
Public Function TotalPages() as String
Dim str as String
str = Me.Report.Globals!TotalPages.ToString()
Return str
End Function
Now create your Group with Page Break as below SSRS expression:
= IIf ( CInt(Code.PageNumber()) = 1, Ceiling((RowNumber(Nothing)) / 10), Ceiling((RowNumber(Nothing)) / 15) )
The result will be like the following image:
References and helpful links
Another method to keep group rows on the same page is by setting the Keep together
propery to true:
Row_Group >> Properties >> Keep together = True.