asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search





Subscribe Now!
Free Newsletter
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

-->
Interactive Sorting in SQL Server Reporting Services
By Bhargava Pandey
Rating: 2.9 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article



    Introduction

    SQL Server 2005 Reporting Services has an interactive sorting feature built-in. It allows you to click on the header of a column in a report and sort the report by that column in either ascending or descending order. Unfortunately SQL Server 2000 does not include this feature. However; we can use the Render Report by URL technique to implement interactive sorting in SQL Server 2000 Reporting Services.

    To achieve this we render the report by creating the entire URL for the report which has all the parameters and their values in the URL generated with the "SORTBY" and "Direction" parameters (these two are added to achieve the interactive sorting). We then append the value of the column header (Field Value in details section) as "SORTBY" while the value of the "Direction" parameter toggles between ASC to DESC. We also add the code to sort TAB of property of Table on which sorting is to be implemented.

    Step-by-Step Walkthrough

    1. Create data source

    2. Provide correct credentials

    3. Create Report (as shown below)

    4. Add the two parameters DIRECTION and SORTBY. These two parameters are in addition to any existing parameters.

      And set their properties as follows:

      DIRECTION
      Prompt = DIRECTION
      DataType = String
      Available Value = Non Queried

      SORTBY
      Prompt = SORTBY
      DataType = String
      Available Value = Non Queried

    5. Select Table -> Properties

    6. Select Sorting Tab

      Enter expression as

      =iif(Parameters!DIRECTION.Value="Asc",Fields(Parameters!SORTBY.Value).Value,0) Direction Ascending

      and

      =iif(Parameters!DIRECTION.Value="Desc",Fields(Parameters!SORTBY.Value).Value,0) Direction Descending

      As shown below

    7. Select the Column Header -> Property -> Advanced

    8. Select Navigation Tab

    9. Select Jump to URL

    10. Enter expression as

      ="http://localhost/reportserver?%2fArticle%2fNorthwind"& "&SORTBY=OrderID&DIRECTION=" & iif(Parameters!DIRECTION.Value="Asc","Desc","Asc")

    11. Repeat the previous step for each column. Please note to change the value of the SORTBY parameter to equal the field name. Like OrderID for first column in this example.

    12. Deploy the report on Server. Run the report and click on the header of the column by which you want to sort the report.

    Conclusion

    This article showed how you can use the Render Report by URL technique to implement interactive sorting in SQL Server Reporting Services.

  • Rate This Article
    Not HelpfulMost Helpful
    1 2 3 4 5
    Other Articles
    Jul 21, 2005 - N-Tier Web Applications using ASP.NET 2.0 and SQL Server 2005 - Part 1
    While the .NET Framework made building ASP.NET applications easier then it had ever been in the past, .NET 2.0 builds on that foundation in order to take things to the next level. This article shows you to how to construct an N-Tier ASP.NET 2.0 Web application by leveraging the new features of ASP.NET 2.0 and SQL Server 2005.
    [Read This Article]  [Top]
    Apr 28, 2005 - New Files and Folders in ASP.NET 2.0
    With the release of ASP.NET 2.0, Microsoft has greatly increased the power of ASP.NET by introducing a suite of new features and functionalities. As part of this release, ASP.NET 2.0 also comes with a host of new special files and folders that are meant to be used to implement a specific functionality. This article examines these new files and folders in detail and provides examples that demonstrate how to utilize them to create ASP.NET 2.0 applications.
    [Read This Article]  [Top]
    Mar 10, 2005 - The DataSet Grows Up in ADO.NET 2.0 - Part 2, Cont'd
    Alex Homer continues his detailed look at the major changes to the DataSet class. In this part, he looks at two features that allow developers to work with data in a more structured and efficient way when using the DataSet with a SQL Server 2005 database server.
    [Read This Article]  [Top]
    Mar 9, 2005 - The DataSet Grows Up in ADO.NET 2.0 - Part 2
    Alex Homer continues his detailed look at the major changes to the DataSet class. In this part, he looks at two features that allow developers to work with data in a more structured and efficient way when using the DataSet with a SQL Server 2005 database server.
    [Read This Article]  [Top]
    Mar 3, 2005 - The DataSet Grows Up in ADO.NET 2.0 - Part 1, Cont'd
    In this article, Alex Homer looks at the changes between the version 1.x and version 2.0 DataSet and their associated classes, showing you how you can take advantage of the new features to improve your applications' capabilities and performance.
    [Read This Article]  [Top]
    Mar 2, 2005 - The DataSet Grows Up in ADO.NET 2.0 - Part 1
    In this article, Alex Homer looks at the changes between the version 1.x and version 2.0 DataSet and their associated classes, showing you how you can take advantage of the new features to improve your applications' capabilities and performance.
    [Read This Article]  [Top]
    Feb 16, 2005 - Writing a Custom Membership Provider for the Login Control in ASP.NET 2.0
    In ASP.NET 2.0 and Visual Studio 2005, you can quickly program custom authentication pages with the provided Membership Login controls. In this article, Dina Fleet Berry examines the steps involved in using the Login control with a custom SQL Server membership database.
    [Read This Article]  [Top]
    Dec 29, 2004 - ClickOnce Deployment in .NET Framework 2.0
    In this article, Thiru Thangarathinam examines .NET 2.0's new ClickOnce deployment technology that is designed to ease deployment of Windows forms applications. This new technology not only provides an easy application installation mechanism, it also eases deployment of upgrades to existing applications.
    [Read This Article]  [Top]
    Dec 15, 2004 - A Sneak Peek at ASP.NET 2.0's Administrative Tools
    With ASP.NET 2.0, Microsoft has made great strides in increasing developer productivity and has made implementing previously complex solutions relatively easy. Where this version of ASP.NET really shines, however, is in its new administrative tools that allow developers to spend less time managing the configuration of the servers and software and more time developing great code.
    [Read This Article]  [Top]
    Nov 17, 2004 - The ASP.NET 2.0 TreeView Control
    Thiru Thangarathinam introduces ASP.NET 2.0's new TreeView control which provides a seamless way to consume and display information from hierarchical data sources. The article discusses this new control in depth and explains how to use this feature rich control in your ASP.NET applications.
    [Read This Article]  [Top]
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry