Print Page | Close Window

CXTPReportControl group caption

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=1919
Printed Date: 07 November 2025 at 2:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl group caption
Posted By: markr
Subject: CXTPReportControl group caption
Date 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.




Replies:
Posted By: sserge
Date 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


Posted By: markr
Date 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.



Posted By: sserge
Date 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


Posted By: Oleg
Date 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


Posted By: markr
Date 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.




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