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

CXTPReportControl::ReleaseItem error

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

Joined: 22 December 2006
Location: Korea, South
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote yayo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportControl::ReleaseItem error
    Posted: 14 February 2007 at 5:15am

 // yayo 2007.02.14 ==> modify

 int nColCnt = pColumns->GetCount()-1;
 for (i = nColCnt; i >=0 ; i--)
 {
  CXTPReportColumn* pColumn = pColumns->GetAt(i);

  if (pColumn->m_nItemIndex > nIndex)
  {
   pColumn->m_nItemIndex--;
  }
  else if (pColumn->m_nItemIndex == nIndex)
  {
   pColumns->Remove(pColumn);
  }
 }

 //for (i = 0; i < pColumns->GetCount(); i++)
 //{
 // CXTPReportColumn* pColumn = pColumns->GetAt(i);

 // if (pColumn->m_nItemIndex > nIndex) // not excute
 // {
 //  pColumn->m_nItemIndex--;
 // }
 // else if (pColumn->m_nItemIndex == nIndex)
 // {
 //  pColumns->Remove(pColumn);
 // }
 //}

 
 
hi
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: 16 February 2007 at 4:29pm
Hi, thanks! This should be actually modified, but your version is also not quite correct. Final version will be:

CXTPReportColumn* pColumnToRemove = NULL;
 
 for (i = 0; i < pColumns->GetCount(); i++)
 {
  CXTPReportColumn* pColumn = pColumns->GetAt(i);
 
  if (pColumn->m_nItemIndex > nIndex)
  {
   pColumn->m_nItemIndex--;
  }
  else if (pColumn->m_nItemIndex == nIndex)
  {
   pColumnToRemove = pColumn;
  }
 }
 
 if (pColumnToRemove)
  pColumns->Remove(pColumnToRemove);


--
WBR,
Serge
Back to Top
yayo View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2006
Location: Korea, South
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote yayo Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2007 at 5:39am

OK, It is my mistake !!

thanks!!
hi
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.188 seconds.