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

11.2.0 CXTPReportControl Remove/AddRecordEx

 Post Reply Post Reply
Author
Message
bschaer View Drop Down
Groupie
Groupie


Joined: 27 June 2006
Location: United States
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote bschaer Quote  Post ReplyReply Direct Link To This Post Topic: 11.2.0 CXTPReportControl Remove/AddRecordEx
    Posted: 15 September 2007 at 12:35pm
The logic you have outlined for updating record data does not work with 11.2.0 because on the RemoveRecordEx call, the record is deleted upon InternalRelease.  So I wrapped the Remove/Add with AddRef/Release (below) and this creates a new problem with the row logic at XTReportRow.cpp line 814 (ASSERT(m_pParentRows->GetAt(m_nChildIndex) == this);
 
When only one record is added/updated, no ASSERT triggered.  On second record added then updated you get it.
 
I need on the fly inserts and updates without using Populate.  The updates need to perform resort/regroup as necessary and I believe you have coded that way.
 
This is a critical situation that I need resolution on soon.  Thanks.
 
For new record:
CMyReportRecord* pNew = new CMyReportRecord();
pRecord->m_pSomeItem->SetValue(SomeInitialValue);
GetReportCtrl().AddRecordEx(pNew);
GetReportCtrl().RedrawControl();
 
For update record:
pRecord->m_pSomeItem->SetValue(SomeNewValue);
pRecord->InternalAddRef();
GetReportCtrl().RemoveRecordEx(pRecord);
GetReportCtrl().AddRecordEx(pRecord);
pRecord->InternalRelease();
GetReportCtrl().RedrawControl();
 
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.078 seconds.