Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Custom sorting for Crystal Report Cross-Tab

4.70/5 (6 votes)
14 Nov 2012CPOL1 min read 57.5K   1.1K  
Article describes how to apply a custom sorting for Cross-Tab

Introduction

Following article guides you to apply a custom sorting functionality to a Crystal Report Cross-Tab. Hope you have some basic knowledge in creating a basic crystal report.

Background  

Following illustration shows before applying the sorting functionality. Below image shows wrong order of month on column headers. Let's try to order the column headers on as Jan, Feb, Mar...etc. 

Image 1

Resolution  

Open the Crystal Report on the designer and select Group Options on Column section on Cross-Tab expert. 

Image 2

On the the Common tab select "In Specific Order" from sort drop down. On the specific Order tab select New button. 

Image 3

Now add each group for each moth. Type the group name as "Jan" and "is equal to "Jan". The value you enter here should be match with data on Month column on your data source. Once all months are added output will display as follows 

Image 4

Now if you want change column order Up/Down arrow can be used. Let's say financial year start with April, you can set the month on top using arrows. 

Points of Interest 

  • Typed DataSet is used to create the report schema.
  • 3 column (Month, Qty, Product) data table with dummy data is used populate the report
  • Cross-Tab is added to the report from the designer 

History

  • Nov 14, 2012: Article created. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)