Report Control sort is case sensitive |
Post Reply |
Author | |
ebernard
Newbie Joined: 27 September 2007 Location: Canada Status: Offline Points: 2 |
Post Options
Thanks(0)
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.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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. |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
There is wndReport.GetRecords()->SetCaseSensitive(FALSE); method.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Guys. I am really impressed - 2 profi MFC developers can not found this answer using full MFC source ?! Pain in neck? Hole in head?
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Thanks Oleg! |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
You should talk to Oleg about tact. |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Sorry - just mean that people lazy...
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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. |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
OK, you got me on that one.
How's the beta charts going? |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Should be ready in the end of August for beta
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |