![]() |
11.2.0 CXTPReportControl Remove/AddRecordEx |
Post Reply
|
| Author | |
bschaer
Groupie
Joined: 27 June 2006 Location: United States Status: Offline Points: 29 |
Post Options
Thanks(0)
Quote Reply
Topic: 11.2.0 CXTPReportControl Remove/AddRecordExPosted: 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();
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |