Print Page | Close Window

Problem with CXTPReportControl

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


Topic: Problem with CXTPReportControl
Posted By: WilliamGS
Subject: Problem with CXTPReportControl
Date Posted: 30 November 2005 at 1:42pm

Hello, I have a CXTPReportControl and several records have children records, I am using:

pReportCtrl->GetRecords()->RemoveAll();

to empty the report, but it does not work with child records, only works fine if there are not child records. Is there another way to empty a CXTPReportControl with nested records? I have XTP 9.6

Thanks in advance,

William GS




Replies:
Posted By: sserge
Date Posted: 30 November 2005 at 3:22pm
Hi,

See also http://forum.codejock.com/forum_posts.asp?TID=3051 - http://forum.codejock.com/forum_posts.asp?TID=3051 -- that should be working in latest versions for child records also.

Anyway, you can recursively traverse all records by yourself and delete all children manually.

--
WBR,
Serge


Posted By: WilliamGS
Date Posted: 30 November 2005 at 4:22pm

HI, I have a function that recursively traverse all records and delete children, but is does not work with nested records, this is my code:

void COrgReportCtrlBase::RemoveAllItems()

 CXTPReportRecord *pRecord = NULL;
 for (int nRecIndex = 0; nRecIndex < m_pRecords->GetCount(); nRecIndex++)
 {
  pRecord = m_pRecords->GetAt(nRecIndex);
  ASSERT(pRecord);
  if (pRecord->HasChildren())
   pRecord->GetChilds()->RemoveAll();

 }
 m_pRecords->RemoveAll();
}

COrgReportCtrlBase is derived from CXTPReportControl.

Thanks,

William GS



Posted By: Oleg
Date Posted: 01 December 2005 at 5:00am

You don't need any recursively traverse. Memory will be released automatically:

CXTPReportRecord::~CXTPReportRecord(void)
{
 RemoveAll();

 if (m_pChildren)
 {
  m_pChildren->InternalRelease();
 }
}

 

May be you forgot to call Populate() ?



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: WilliamGS
Date Posted: 01 December 2005 at 10:55am

It does not work too, 'm_pChildren->InternalRelease()' gives a fatal error.

I am trying to delete records and put new, but the old nested records appears mixed with the new records; only the nested records remains.

Is it a bug?



Posted By: Oleg
Date Posted: 02 December 2005 at 12:52am

Hello,

sure you make something in your code. to find what you do wrong need to see your sources, please attach project in issuetrack.

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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