Chapter-9-Sorting of Column and Custom Paging in SSRS

Sorting of Column can be done at query level also, but if the same data source is being used by different application and each require a different soft order, then it is better to do sorting at SSRS Level. After applying the sorting the report will look as given image.

Download Full Tutorial for Chapter-9-Sorting-of-Column-and-Custom-Paging-in-SSRS in PDF format



Download Sample Code for working with SSRS Calculated Fields

Sorting in SSRS
Sorting in SSRS

Step-1: Create a tabular report as it was described in Chapter-1, but with the following SQL Script of “Products” table of “Northwind” database.

select ProductID,ProductName,QuantityPerUnit,UnitPrice,UnitsInStock from Products

Writing SSRS Query
Writing SSRS Query

And report design will look like.



Tabular SSRS Report
Tabular SSRS Report

Step 2: Right click on the column header of “Product Name” and choose Textbox Properties as shown in image.

SSRS Text Box Properties
SSRS Text Box Properties

Step 3: Choose “Interactive Sorting” tab from the Textbox properties dialog and Check the checkbox for “Enable interactive sort on this text box” Choose “Product Name” from the “Sort by” drop down and click on ok and run the report to see the changes.

SSRS Enable Interactive Sorting
SSRS Enable Interactive Sorting

Step-4: Please see the Up and Down arrow on the Header of the field “Product Name” marked with red circle, shorting toolbar is created on header, clicking on this tool will toggle the sorting from ascending and Descending Order of the “Product Name” at run time interactively. Similarly we can create sorting on one or more columns.

SSRS Interactive Sorting
SSRS Interactive Sorting

Step-5: Creating custom paging in SSRS. In the report design screen, right click and from the context menu, choose Add Page Footer

SSRS Interactive Sorting Tool
SSRS Interactive Sorting Tool

After adding a page footer we can add “text box” controls on it from toolbar for showing the custom page number.Adding custom paging in SSRS

Adding custom paging in SSRS

Step 6: Choose the second textbox and click on the Expression and write the following line of code.
=Globals!PageNumber

And similarly for forth textbox write the following code
=Globals!TotalPages.

Step 7: Run the report and Notice the page Number marked with Red Color is coming at end of the page.

SSRS Custom paging
SSRS Custom paging

This is how we can create Custom paging in SSRS. This complete the exercise of “Chapter-9-Sorting of Column and Custom Paging in SSRS”.



Chapter-1: Creating a basic Tabular SSRS Report using Report Wizard
Chapter-2 : Report Deployment on SQL Server 2012 Reporting Server
Chapter-3:Opening/Calling the deployed SQL Server Reporting Server report from Asp.net
Chapter-4 Creating SSRS Matrix Report / Cross Tab Report
Chapter-5 Creating a Sub Report in SSRS
Chapter-6: Creating a Drill Down Report in SSRS
Chapter-7: Working with expressions and custom code in SSRS
Chapter-8-SSRS (Reporting Services) Working with Calculated fields

Leave a Reply

Your email address will not be published. Required fields are marked *

*

7 + two =