Print Page | Close Window

Multiple column sorting in report

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9090
Printed Date: 28 September 2024 at 6:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Multiple column sorting in report
Posted By: k_ha
Subject: Multiple column sorting in report
Date Posted: 13 December 2007 at 7:12am
Hello

Is there any support for multi-column sorting in the ReportControl?
How can I change it, upon user column's sort selection?

Thanks



Replies:
Posted By: SuperMario
Date Posted: 13 December 2007 at 10:08am
Yes, there is.

This sample illustrates how to sort the columns in the ReportControl. If you had 8 columns added to the ReportControl, this sample would sort the columns first by the column at Itemindex 7, then by the column at ItemIndex 2, then by the column at ItemIndex 5.

    'This code below will add three columns to the SortOrder collection of coluns.
    'This will cause the columns in the ReportControl to first be sorted by column 7,
    'which has an index of zero (0) in the SortOrder collection. Columns are first sorted
    'in the order that they are added to the SortOrder collection.
    wndReportControl.SortOrder.Add wndReportControl.Columns(7)
    wndReportControl.SortOrder.Add wndReportControl.Columns(2)
    wndReportControl.SortOrder.Add wndReportControl.Columns(5)

    'This will cause the column at index 0 of the SortOrder collection to be sorted
    'in descending order.
    wndReportControl.SortOrder(1).SortAscending = False




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net