Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Use my own CXTPReportRecords derived class
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Use my own CXTPReportRecords derived class

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1070
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Use my own CXTPReportRecords derived class
    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 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1070
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2017 at 3:03pm
Still not solved!?!
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1070
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
BobC View Drop Down
Groupie
Groupie


Joined: 28 April 2017
Location: Longmont, CO
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobC Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1070
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2019 at 12:17pm
I'll check this...
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.