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.
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
And report design will look like.
Step 2: Right click on the column header of “Product Name” and choose Textbox Properties as shown in image.
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.
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.
Step-5: Creating custom paging in SSRS. In the report design screen, right click and from the context menu, choose Add Page Footer
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
Step 6: Choose the second textbox and click on the Expression and write the following line of code.
And similarly for forth textbox write the following code
Step 7: Run the report and Notice the page Number marked with Red Color is coming at end of the page.
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