Print Page | Close Window

Report Control sort is case sensitive

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14956
Printed Date: 14 May 2024 at 11:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control sort is case sensitive
Posted By: ebernard
Subject: Report Control sort is case sensitive
Date Posted: 12 August 2009 at 11:34am
Is this intentional? I cannot think of a single instance where I'd want this, and I have to perform custom sorting to have it case-insensitive.



Replies:
Posted By: adrien
Date Posted: 12 August 2009 at 8:52pm
I agree

it's a pain in the neck. every time I use the report control I have to create a new type of item for text so it can be sorted case-insensitively.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: mdoubson
Date Posted: 12 August 2009 at 9:20pm

Why you not post in ReportControl section? But case-sensitive is proper default. If you don't like it - supply your own m_pRowsCompareFunc - not a big deal...



-------------
Mark Doubson, Ph.D.


Posted By: Oleg
Date Posted: 13 August 2009 at 1:44am
Hi,
 
There is wndReport.GetRecords()->SetCaseSensitive(FALSE); method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mdoubson
Date Posted: 13 August 2009 at 8:03am
Guys. I am really impressed - 2 profi MFC developers can not found this answer using full MFC source ?! Pain in neck? Hole in head?

-------------
Mark Doubson, Ph.D.


Posted By: adrien
Date Posted: 13 August 2009 at 9:10am
Originally posted by oleg oleg wrote:

Hi,
 

There is wndReport.GetRecords()->SetCaseSensitive(FALSE); method.


Thanks Oleg!


-------------
http://www.wingate.com - http://www.wingate.com


Posted By: adrien
Date Posted: 13 August 2009 at 9:15am
Originally posted by mdoubson mdoubson wrote:

Guys. I am really impressed - 2 profi MFC developers can not found this answer using full MFC source ?! Pain in neck? Hole in head?


You should talk to Oleg about tact.


-------------
http://www.wingate.com - http://www.wingate.com


Posted By: mdoubson
Date Posted: 13 August 2009 at 9:25am
Sorry - just mean that people lazy...

-------------
Mark Doubson, Ph.D.


Posted By: adrien
Date Posted: 13 August 2009 at 10:02am
If you saw the amount of code I wrote to get case-insensitivity, you wouldn't call it lazy.

it's not intuitive to call a function on the records array object to set case-insensitivity for comparisons on a field in columns. I'm not the only one here who resorted to subclassing CXTPReportControlItemText to get a non-case-sensitive virtual Compare function.

So to me this points to issues in the documentation.

As for finding things in the help file...

And we can't go trawling the code looking for solutions all the time. We can only look so long.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: mdoubson
Date Posted: 13 August 2009 at 10:07am
Maybe you right but we all manage to use Google for any info - why not use Visual Studio in same way:

Find all "CaseSensitive", Subfolders, Find Results 1, "Entire Solution", "*.c;*.cpp;*.cxx;*.cc;*.tli;*.tlh;*.h;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc"

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(407):HTREEITEM CXTTreeBase::FindItemInBranch(LPCTSTR lpszSearch, BOOL bCaseSensitive /*= FALSE*/,

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(422): if (!bCaseSensitive)

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(432): htiFound = FindItemInBranch(lpszSearch, bCaseSensitive, bWholeWord, htiChild);

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(438): if (!bCaseSensitive)

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(490):HTREEITEM CXTTreeBase::FindItem(LPCTSTR lpszSearch, BOOL bCaseSensitive /*= FALSE*/,

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(524): if (!bCaseSensitive)

F:\CodejockSVN\Source\Controls\XTTreeBase.cpp(539): if (!bCaseSensitive)

F:\CodejockSVN\Source\Controls\XTTreeBase.h(151): // bCaseSensitive - TRUE if the search should be case sensitive.

F:\CodejockSVN\Source\Controls\XTTreeBase.h(161): virtual HTREEITEM FindItem(LPCTSTR lpszSearch, BOOL bCaseSensitive = FALSE, BOOL bDownDir = TRUE, BOOL bWholeWord = FALSE, HTREEITEM hItem = NULL);

F:\CodejockSVN\Source\Controls\XTTreeBase.h(169): // bCaseSensitive - TRUE if the search should be case sensitive.

F:\CodejockSVN\Source\Controls\XTTreeBase.h(178): virtual HTREEITEM FindItemInBranch(LPCTSTR lpszSearch, BOOL bCaseSensitive /*= FALSE*/, BOOL bWholeWord /*= FALSE*/, HTREEITEM htiItem /*= NULL*/);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.cpp(659): ULONG dwFlags = m_pRecord->GetRecords()->IsCaseSensitive() ? 0 : NORM_IGNORECASE;

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.cpp(48): m_bCaseSensitive = TRUE;

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.cpp(357): if (!IsCaseSensitive())

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.cpp(612): DISP_PROPERTY_ID(CXTPReportRecords, "CaseSensitive", 8, m_bCaseSensitive, VT_BOOL)

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(246): // bCaseSensitive - TRUE if string comparisons are case-sensitive; otherwise, FALSE. The default is FALSE.

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(247): // See Also: IsCaseSensitive

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(249): void SetCaseSensitive(BOOL bCaseSensitive);

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(254): // See Also: SetCaseSensitive

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(256): BOOL IsCaseSensitive() const;

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(267): // See Also: SetCaseSensitive

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(348): BOOL m_bCaseSensitive; // Indicating whether string comparisons are case-sensitive.

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(394):AFX_INLINE void CXTPReportRecords::SetCaseSensitive(BOOL bCaseSensitive)

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(396): m_bCaseSensitive = bCaseSensitive;

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(399):AFX_INLINE BOOL CXTPReportRecords::IsCaseSensitive() const

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(401): return m_bCaseSensitive;

F:\CodejockSVN\Source\ReportControl\XTPReportRows.cpp(416): ULONG dwFlags = pRecord->GetRecords()->IsCaseSensitive() ? 0 : NORM_IGNORECASE;

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditCtrl.cpp(158):, m_bCaseSensitive(TRUE)

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditCtrl.h(2879): BOOL m_bCaseSensitive; // Case sensitive

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(79): XTPLEX_ATTR_CASESENSITIVE,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(1920): m_bCaseSensitive_Cached = -1; // ask

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2393): BOOL bNoCase = !IsCaseSensitive();

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2414):BOOL CXTPSyntaxEditLexClass::IsCaseSensitive()

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2416): if (m_bCaseSensitive_Cached < 0)

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2418): m_bCaseSensitive_Cached = FALSE;

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2420): CXTPSyntaxEditLexVariantPtr ptrCase = GetAttribute(XTPLEX_ATTR_CASESENSITIVE, TRUE);

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2423): m_bCaseSensitive_Cached = ptrCase->m_nValue > 0;

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2426): return m_bCaseSensitive_Cached;

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2462): BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2471): nRes = StrCmp(pcszStr1, pcszStr2, 1, bCaseSensitive);

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(2489): nRes = StrCmp(pcszStr1, pcszStr2, nLen, bCaseSensitive);

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3207): strTokenVal, 1024, FALSE, !IsCaseSensitive());

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3299): BOOL bCaseSensitive = IsCaseSensitive();

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3301): return Run_Tags1(pIter, pLVTags, rstrTagVal, bCaseSensitive, bParseDirection_Back);

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3306): CString& rstrTagVal, BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3322): if (Run_Tags2(pIter, pVTag, rstrTagVal, bCaseSensitive, bParseDirection_Back) )

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3333): BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.cpp(3369): if (StrCmpEQ(pcszTag, pText, nLen, bCaseSensitive, bParseDirection_Back))

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(515): static const TCHAR XTPLEX_ATTR_CASESENSITIVE[] = _T("CaseSensitive"); // Lex Class CaseSensitive flag.

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(633): // "CaseSensitive" attribute value..

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(636): // "CaseSensitive" attribute value.

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(638): // GetAttribute(), XTPLEX_ATTR_CASESENSITIVE, Classes schema syntax.

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(640): virtual BOOL IsCaseSensitive();

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(838): BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(845): BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(856): BOOL bCaseSensitive);

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(859): BOOL bCaseSensitive,

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(950): int m_bCaseSensitive_Cached;

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(989): int nLen, BOOL bCaseSensitive)

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexClass.h(991): if(bCaseSensitive) {

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexParser.cpp(1378): //BOOL bCase = FALSE; //pRunClass->IsCaseSensitive();

F:\CodejockSVN\Source\SyntaxEdit\XTPSyntaxEditLexParser.cpp(1393): BOOL bCase = FALSE; //pRunClass->IsCaseSensitive();

F:\CodejockSVN\Samples\SyntaxEdit\MDITextEditor\_cpp1_schclass.h(7):sb += _T(" caseSensitive = 1\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\MDITextEditor\_cpp1_schclass.h(25):sb += _T(" caseSensitive = 0\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\MDITextEditor\_cpp2_schclass.h(7):sb += _T(" caseSensitive = 1\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\MDITextEditor\_cpp2_schclass.h(25):sb += _T(" caseSensitive = 0\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\SyntaxEditOnDialog\SyntaxEditOnDialogDlg.cpp(110): sb += _T(" caseSensitive = 1\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\SyntaxEditOnDialog\SyntaxEditOnDialogDlg.cpp(128): sb += _T(" caseSensitive = 0\r\n");

F:\CodejockSVN\Samples\ReportControl\ReportPaneView\ReportPaneViewView.cpp(213): //GetReportCtrl().GetRecords()->SetCaseSensitive(FALSE);

F:\CodejockSVN\Samples\SyntaxEdit\SyntaxEditOnDialogMod\SyntaxEditOnDialogDlg.cpp(503): sb += _T(" caseSensitive = 1\r\n");

F:\CodejockSVN\Samples\SyntaxEdit\SyntaxEditOnDialogMod\SyntaxEditOnDialogDlg.cpp(521): sb += _T(" caseSensitive = 0\r\n");

Matching lines: 71 Matching files: 16 Total files searched: 1181



-------------
Mark Doubson, Ph.D.


Posted By: adrien
Date Posted: 13 August 2009 at 10:25am
OK, you got me on that one.

How's the beta charts going?

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: mdoubson
Date Posted: 13 August 2009 at 10:41am
Should be ready in the end of August for beta

-------------
Mark Doubson, Ph.D.


Posted By: znakeeye
Date Posted: 13 August 2009 at 12:35pm
Originally posted by adrien adrien wrote:

it's not intuitive to call a function on the records array object to set case-insensitivity for comparisons on a field in columns
 
Agree. I made such an record item- class too... Also, that particular function came in 10.3 something if I recall correctly...


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: mdoubson
Date Posted: 13 August 2009 at 12:42pm
Still guys - first thing coming to mind in such case - search code fo Compare(...) function

Find all "Compare(", Subfolders, Find Results 1, "Entire Solution", "*.c;*.cpp;*.cxx;*.cc;*.tli;*.tlh;*.h;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc"

F:\CodejockSVN\Source\ReportControl\XTPReportControl.cpp(1343): if (pLastGroup && GetRecords()->Compare(pLastGroup->GetCaption(), strGroup) == 0)

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItem.cpp(1206):int CXTPReportRecordItem::Compare(CXTPReportColumn* pColumn, CXTPReportRecordItem* pItem)

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItem.cpp(1214): return m_pRecord->GetRecords()->Compare(GetCaption(pColumn), pItem->GetCaption(pColumn));

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItem.cpp(1250): return m_pRecord->GetRecords()->Compare(m_strGroupCaption, pItem->m_strGroupCaption);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItem.cpp(1257): return Compare(pColumn, pItem);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItem.h(897): virtual int Compare(CXTPReportColumn* pColumn, CXTPReportRecordItem* pItem);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.cpp(244):int CXTPReportRecordItemNumber::Compare(CXTPReportColumn*, CXTPReportRecordItem* pItem)

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.cpp(364):int CXTPReportRecordItemDateTime::Compare(CXTPReportColumn*, CXTPReportRecordItem* pItem)

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.cpp(650):int CXTPReportRecordItemVariant::Compare(CXTPReportColumn*, CXTPReportRecordItem* pItem)

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.h(200): int Compare(CXTPReportColumn* pColumn, CXTPReportRecordItem* pItem);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.h(300): int Compare(CXTPReportColumn* pColumn, CXTPReportRecordItem* pItem);

F:\CodejockSVN\Source\ReportControl\XTPReportRecordItemText.h(418): int Compare(CXTPReportColumn* pCol, CXTPReportRecordItem* pItem);

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.cpp(355):int CXTPReportRecords::Compare(const CString& str1, const CString& str2) const

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.cpp(360): return str1.Compare(str2);

F:\CodejockSVN\Source\ReportControl\XTPReportRecords.h(269): virtual int Compare(const CString& str1, const CString& str2) const;

F:\CodejockSVN\Source\ReportControl\XTPReportRows.cpp(243): int nCompareResult = pItem1->Compare(pColumn, pItem2);

F:\CodejockSVN\Source\ReportControl\XTPReportRows.cpp(325): int nCompareResult = pItem1->Compare(pColumn, pItem2);

Matching lines: 165 Matching files: 56 Total files searched: 1181


-------------
Mark Doubson, Ph.D.


Posted By: mgampi
Date Posted: 14 August 2009 at 3:59am
Hi;

Most of the time when I don't know how to solve an issue I also don't know what to search in code for!
So it would be much better and not so much time consuming for us customers to find it in the 'well written' toolkit documentation


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: mdoubson
Date Posted: 14 August 2009 at 8:33am

In general - yes, in particular case - when I run my app and see that sort is going not as I like - idea to check case-sensitivity is laying on surface 



-------------
Mark Doubson, Ph.D.



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