Print Page | Close Window

11.2.0 CXTPReportControl Remove/AddRecordEx

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=8020
Printed Date: 13 November 2025 at 9:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: 11.2.0 CXTPReportControl Remove/AddRecordEx
Posted By: bschaer
Subject: 11.2.0 CXTPReportControl Remove/AddRecordEx
Date 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();
 



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