Print Page | Close Window

Alphabetical Sorting Error

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=3401
Printed Date: 23 November 2024 at 8:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Alphabetical Sorting Error
Posted By: EricM
Subject: Alphabetical Sorting Error
Date 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

 




Replies:
Posted By: EricM
Date 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



Posted By: sserge
Date 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



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