Print Page | Close Window

Override CXTPReportSection::Draw

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=22580
Printed Date: 16 November 2024 at 8:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Override CXTPReportSection::Draw
Posted By: shanmuganathan
Subject: Override CXTPReportSection::Draw
Date 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);
}

...
}

}





Replies:
Posted By: olebed
Date Posted: 22 April 2015 at 6:16am
Hello, did you try #include "XTPReportBorder.h" before CMyReportSection declaration ?


Posted By: shanmuganathan
Date Posted: 22 April 2015 at 6:36am
Yes. i have #include "XTPReportBorder.h" in my code.


Posted By: olebed
Date 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);
}
}


Posted By: shanmuganathan
Date Posted: 22 April 2015 at 7:28am
Thanks. Now it is working.



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