Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Multiple column sorting in report
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple column sorting in report

 Post Reply Post Reply
Author
Message
k_ha View Drop Down
Newbie
Newbie


Joined: 13 December 2007
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote k_ha Quote  Post ReplyReply Direct Link To This Post Topic: Multiple column sorting in report
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.