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

Problem with CXTPReportControl

 Post Reply Post Reply
Author
Message
WilliamGS View Drop Down
Newbie
Newbie


Joined: 18 April 2005
Location: Peru
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote WilliamGS Quote  Post ReplyReply Direct Link To This Post Topic: Problem with CXTPReportControl
    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

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: 30 November 2005 at 3:22pm
Hi,

See also 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
Back to Top
WilliamGS View Drop Down
Newbie
Newbie


Joined: 18 April 2005
Location: Peru
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote WilliamGS Quote  Post ReplyReply Direct Link To This Post 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

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: 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
Back to Top
WilliamGS View Drop Down
Newbie
Newbie


Joined: 18 April 2005
Location: Peru
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote WilliamGS Quote  Post ReplyReply Direct Link To This Post 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?

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: 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
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.