Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPReportControl group caption
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPReportControl group caption

 Post Reply Post Reply
Author
Message
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportControl group caption
    Posted: 06 March 2005 at 9:46am
Can anyone provide me with a code example of how to create a custom CXTPReportControl group caption? I'm running XTP v9.51.

I've tried over-riding GetGroupCaption(CXTPReportColumn* pColumn) in my CXTPReportRecordItem subclass, but it never seems to fire.

Any help would be greatly appreciated.

- Mark R.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2005 at 2:27am
Hi Mark,

Take a look at the sample application -- there are a number of working examples like following:

class CMessageRecordItemXXX : public CXTPReportRecordItemYYY
{
...
     virtual CString GetGroupCaption(CXTPReportColumn* pColumn);
...
}

There must be some another problem in your code if such overriding is not working...

I'd probably say more about that if you list a piece of your code.

--
Best regards,
Sergey
Back to Top
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2005 at 6:10pm
Hi Sergey,

Thanks very much for your prompt reply. I must be overlooking something obvious. I'll post a quick code snippet here and risk public embarrasment.  :-)

Here's the class definition:

class CDupReportRecordSize : public CXTPReportRecordItem
{
public:
    CDupReportRecordSize(__int64 nSize = 0);
    CString GetCaption();
    CString GetGroupCaption(CXTPReportColumn* pColumn);
protected:
    __int64 m_nSize;
};

And the (relevant part of the) implementation:

CString CDupReportRecordSize::GetGroupCaption(CXTPReportColumn* pColumn)
{
    return "test";
}

What's interesting is that the implementation for the GetCaption() override works fine - by which I mean that it actually fires. But the GetGroupCaption function never does (I can set a breakpoint and I get nothing).

- Mark R.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2005 at 11:30am
Mark,

It's strange -- your example actually works fine for me and returns test string when grouping by the associated column.

Try adding grouping somewhere inside Report Control initializing:

(like in the sample application)

// Find your column associated with this Record Item
CXTPReportColumn* pColSize = pReportCtrl->GetColumns()->Find(COLUMN_YOUR_SIZE);&nbs p;         
// Clear all other grouping
pReportCtrl->GetColumns()->GetGroupsOrder()->Clear( );
// Group report control by the found column
pReportCtrl->GetColumns()->GetGroupsOrder()->Add(pC olSize);

--
Regards,
Sergey
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2005 at 9:09am

markr, seems you have old version, check parameters of

GetGroupCaption in source.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2005 at 9:03pm
Thanks to you both, I've got it working now.

Excellent product, and thanks for your prompt support.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.