Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Alphabetical Sorting Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Alphabetical Sorting Error

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


Joined: 12 December 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote EricM Quote  Post ReplyReply Direct Link To This Post Topic: Alphabetical Sorting Error
    Posted: 13 December 2005 at 1:58am

The column sorting in Report Controls does not seem to be correct, unless someone changed the alphabet and didn't tell me.  : )

The following is considered to be sorted in ascending order by the Report Control:

Bruce Wayne
COdejock Exchange
CodeToolBox.com Team
Codejock Exchange
Peter Parker
hodejock Exchange

Note that capitilizing any letter throws it off, no matter if it's the first letter (notice the h-odejock) or the fourth letter (CodeTool shows up before CodeJock).

I think the fix is probably the use of CString::CompareNoCase() instead of CString::Compare()...  now to just trace where that comparison happens...

E

 

Back to Top
EricM View Drop Down
Newbie
Newbie


Joined: 12 December 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote EricM Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 2:12am

After changing CString::Compare to CString::CompareNoCase in the following functions it seems to work fine now:

CXTPReportRecordItem::CompareGroupCaption()
and
CXTPReportRecordItem::Compare()

I will admit that someone might want sorting to be case dependent in a Report Control, so my suggestion would be to put in a flag that allows such....??

E

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 4:49pm
It is only your choice how you'd like your captions to be compared for items of your columns. You can always override this behavious for your specific items like it is shown in the standard sample in a few implementations of CompareGroupCaption method.

--
WBR,
Serge
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.141 seconds.