Display a fixed number of rows per page for an SSRS report

 

Follow these steps to display a fixed number of records per page


  • First create Query and create dataset then insert table and add details in table.
  • Add a Parent Group to the existing top level row group. The recently                  created Tablix doesn’t have a row group, so right click on Details (under Row Groups section), click on “Add Group” and then Parent Group. You can refer to the below image.



  • Once you click on Parent Group, it will open a Tablix Group. In the Group By expression, enter =CEILING(RowNumber(Nothing)/25) where 25 is the number of records to be displayed per page. If you want to display 50 records then choose 50.In the expression I have used the Ceiling function (which returns the smallest integer greater than, or equal to, the specified numeric expression) and the RowNumber function (which performs a running count of rows within a specified scope). The “Nothing” keyword is used when you want to perform a running count of rows for the topmost group or data region. You may have to replace the “Nothing” keyword with the name of a specific data region or group. There is no need to check the Add group header and Add group footer checkboxes. You can refer to the below image.


  • Right click on the recently created group “Group1” and click on Group Properties.
  • Once you click on Group Properties, it will open a Group Property window. Please give a proper name to this group, because SSRS by default gives a group name which is not descriptive. It is important to give a useful name, so that it will make sense to the next person who is trying to understand the report definition.
  • Next, click on Page Breaks and then check “Between each instance of a group”. Don’t choose to break at the start or end of a group.
  • SSRS automatically creates sorting when a group is created and sorting will be the same as the Group By expression. When the “Page_Break_Group” group was created, sorting was also created. In our case this sorting expression will cause an error, so we have to remove it. To remove sorting go to the Sorting section and delete the sorting.
  • We don’t need the first column from the Tablix, this column was created automatically when we created the “Page_Break_Group” group. Lastly, delete the first column.
  • To delete the first column, right click on the first column then click on “Delete Columns”. We have to keep the group because it contains the Ceiling function, so choose the second radio button “Delete columns only” and then click “OK”.














 

Comments

Popular posts from this blog

How to Reset Terminal license on Windows 2008, 2008 R2 and 2012

How to remove a static IP configuration for an absent network adapter or uninstall hidden network adapter