Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Override CXTPReportSection::Draw
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Override CXTPReportSection::Draw

 Post Reply Post Reply
Author
Message
shanmuganathan View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanmuganathan Quote  Post ReplyReply Direct Link To This Post Topic: Override CXTPReportSection::Draw
    Posted: 22 April 2015 at 2:36am
I have inherited a class CMyReportSection from CXTPReportSection and override
the method Draw(). But i am getting the following error if i use the variable m_pBorder.

error C2027: use of undefined type 'CXTPReportBorder'

How to fix this error ?

class CMyReportSection : public CXTPReportSection
{

CMyReportSection (CXTPReportControl *pControl, XTPReportRowType rowType) 
: CXTPReportSection(pControl, rowType)
{
}

~CMyReportSection ()
{
}

void CMyReportSection ::Draw(CDC *pDC)
{
CRect rcSection(m_rcSection);

// Draw border
if (NULL != m_pBorder)
{
m_pBorder->SetBorderColor(m_pControl->GetPaintManager()->GetGridColor());
m_pBorder->Draw(pDC, rcSection);

// Deduct margin, border and padding from section rectangle
rcSection = CXTPReportBorder::DeflateRect(rcSection, m_pBorder);
}

...
}

}


Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2015 at 6:16am
Hello, did you try #include "XTPReportBorder.h" before CMyReportSection declaration ?
Back to Top
shanmuganathan View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanmuganathan Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2015 at 6:36am
Yes. i have #include "XTPReportBorder.h" in my code.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2015 at 6:51am
---------------------------- [header file] -------------------------------------
class CMyReportSection : public CXTPReportSection
{
public:
CMyReportSection (CXTPReportControl *pControl, XTPReportRowType rowType)
: CXTPReportSection(pControl, rowType)
{
}

~CMyReportSection ()
{
}

void Draw(CDC *pDC);
};

-------------------------------- [source file] -------------------------------
#include "[header file]"
#include "ReportControl\XTPReportBorder.h"

void CMyReportSection::Draw(CDC *pDC)
{
CRect rcSection(m_rcSection);

// Draw border
if (NULL != m_pBorder)
{
m_pBorder->SetBorderColor(m_pControl->GetPaintManager()->GetGridColor());
m_pBorder->Draw(pDC, rcSection);

// Deduct margin, border and padding from section rectangle
rcSection = CXTPReportBorder::DeflateRect(rcSection, m_pBorder);
}
}
Back to Top
shanmuganathan View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanmuganathan Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2015 at 7:28am
Thanks. Now it is working.
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.156 seconds.