Print Page | Close Window

HOWTO: Use my own CXTPReportRecords derived class

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=21624
Printed Date: 16 April 2024 at 12:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Use my own CXTPReportRecords derived class
Posted By: mgampi
Subject: HOWTO: Use my own CXTPReportRecords derived class
Date Posted: 03 May 2013 at 4:35am
Hi;

I have to change the sorting algorithm used for all text items in any report control of my application. So I checked the code and found out that best would be to overwrite the virtual CXTPReportRecords::Compare() function. But I can't find any way to use my own CXTPReportRecords collection like in CreateGroupRow()...
What is the meaning of virtual functions when I can't derive?

All I want to achieve is, that the control should use locale setting when comparing strings!
I don't want to derive any item class - thats too boring.

Any help or hint is very welcome.




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

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



Replies:
Posted By: mgampi
Date Posted: 29 May 2017 at 3:03pm
Still not solved!?!


-------------
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: mgampi
Date Posted: 26 February 2019 at 7:38am
Hi;

Any news regarding my question?
Can I solve it with 18.6 or higher?


-------------
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: BobC
Date Posted: 27 February 2019 at 11:20am
I have been using CXTPReportControl::SetRowsCompareFunc() to do my row comparisons, with code like this for locale use:
bool operator()(const CBroker& b1, const CBroker& b2)
{
std::locale::global(std::locale(""));  // (*)
std::cout.imbue(std::locale());
auto& f = std::use_facet<std::ctype<char>>(std::locale());

std::string s1(b1.m_sName);
std::string s2(b2.m_sName);

f.tolower(&s1[0], &s1[0] + s1.length());
f.tolower(&s2[0], &s2[0] + s2.length());
return (s1.compare(s2) <= 0);
}


Does that meet your needs, or have I misunderstood your question?


Posted By: mgampi
Date Posted: 27 February 2019 at 12:17pm
I'll check this...


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

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



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