Data Sorting

Built-in Data Sorting Mechanisms

Among the main benefits of a pivot report is its ability to provide summarized data against matching values instead of viewing each and every record in which the corresponding value appears. The ASPxPivotGrid always sorts values in its axes. It does this to merge matching values into a single value. Thus, you get a single entry for the same trademark, model, date, person or whatever information you are analyzing.

By default, the values in the row and column axes are sorted in ascending order. If values are displayed hierachically, the values in the child groups are also sorted.

DevExpress ASP.NET Pivot Grid automatically sorts axis values in ascending order

You can change the sort order for any field by toggling the field's SortOrder property. End-users can do the same by clicking the desired field header. This feature makes it much easier for end-users to find the desired information.

End-users can easily change sort orders by clicking field headers

Sort Values Manually

By default, field values are sorted in alphabetical order (for text based data) and in order of magnitude (for numeric and date/time data). You are not, however, limited to this sorting logic and can choose one of three additional sorting modes: by values (default), display text, or using a custom sorting algorithm. Use the SortMode property to change the sorting algorithm for a specific field. For instance, in the following image string values in the ID field are sorted using a custom sorting routine to maintain a consistent order for identifiers:

ASPxPivotGrid allows you to fine-tune pivot reports by implementing custom data sorting routines

With sorted values, end-users can navigate through reports much more easily and find the entries they are interested in. But often the reverse is required, instead of searching say for how many sales there have been of BMWs, end-users may instead wish to find the brand which has sold the most or least. Instead of searching for how many goals a particular player has scored, they may wish to find the player with the lowest or highest goal count.

Sorting by Summary Values

The ASPxPivotGrid lets you easily solve such reverse data analysis tasks because each field can be sorted by the corresponding total values instead of its own values. All you need to do to make this happen is to specify the field whose summaries should be used for sorting, its value and sort order. The following image shows how you can sort players by the corresponding steal count.

Data mining can become much easier when data is sorted by corresponding grand totals (summaries)

Using the control's built-in UI elements, end-users can sort field values against any data column or row.

Top or Bottom Numbers Report

The ASPxPivotGrid provides yet another feature that can greatly enhance your reports. If end-users are not interested in browsing the entire report but only need to investigate the best or worst results, you can suppress any surplus information. To do this, you can specify the number of results that are displayed for each field. Thus, end-users will see the specified number of best results if a field is sorted in descending order. Switching the sort order will result in displaying the same number of worst results.

Again, only a single property's value needs to be changed to enable this feature. And only a single line of code is required to allow end-users to control this. For instance, consider the following value change handler for a spin editor.

C#
VB
protected void ASPxSpinEdit1_NumberChanged(object source, ExtendedEventArgs e) {
  ASPxPivotGrid4.Fields["Name"].TopValueCount =
  Convert.ToInt32(ASPxSpinEdit1.Number);
}

As a result, end-users obtain full control over the data analysis process and can manipulate data layout as they require. The following image shows a more compact report that has been built by limiting the number of top values displayed on-screen.

With DevExpress ASP.NET Pivot Grid, you can easily display only top or bottom numbers thus suppressing insignificant information

In the image above, the TopValueCount property was set to 4 and as a result four field values were displayed in the Name field. In certain instances, you may not know the exact absolute number of field values that are to be displayed, but instead will know the percentage of significant field values. Assume that you need to list the first 20% of field values. To do this, you only need to set the TopValueType property to Percent (by default it's set to Absolute) and TopValueCount to 20.

At times you may need to inform end-users of how the best or worst results displayed on-screen relate to the rest of their data. End-users may need to know how many points have been scored by the rest of the team or how many sales have been completed for other car trademarks, etc. You can display this information by setting the sorted field's TopValueShowOthers property to true. The following image displays an example wherein a pivot grid shows monthly car sales data. Each month displays the 3 best-selling models and information about the sales by the remaining models.

If only top or bottom values are displayed, you can also see aggregated function value calculated over suppressed results

Back to the Feature List

Subscribe Today
It's Your Choice: All DevExpress ASP.NET AJAX Controls and MVC Extensions can be purchased as part of the following Subscriptions:
Universal Subscription
DXperience Subscription
ASP.NET AJAX Controls
What's New in 2013
The best keeps on getting better. Our newest ASP.NET controls, MVC extensions and features include:
  • Endless Paging
  • New MVC Image Slider
  • New MVC File Manager
  • New MVC Captcha Extension
  • New ASP.NET Image Gallery
  • New Metropolis Blue Theme
  • SharePoint 2013 Support
  • Enhanced Design-Time Experience
  • and more...

What's New in 2013

ASP.NET Tech Library
Explore the power of the DevExpress ASP.NET product line at your pace with the following online technical resources:
Our Awards

              DevExpress Awards : SDTimes 100
              DevExpress Awards : Windows IT Pro Community Choice
              DevExpress Awards : Visual Studio Magazine Readers Choice
              DevExpress Awards : ComponentSource Bestselling Publishers
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

Your Privacy - Legal Statements

Copyright © 1998-2013 Developer Express Inc.
ALL RIGHTS RESERVED
All trademarks or registered trademarks
are property of their respective owners