Print Page | Close Window

How to add record on the fly w/o Populate

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9164
Printed Date: 22 November 2024 at 8:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to add record on the fly w/o Populate
Posted By: mgampi
Subject: How to add record on the fly w/o Populate
Date Posted: 21 December 2007 at 9:20am
Hi;
 
I try to implement AddRecordEx() to add record on the fly without calling Populate(). But my app crashes in AddRecordEx().
 
The code looks like this:
 
CXTPReportRecord* pRecord=new CMyRecord(...);
pRecord->SetVisible(isConditionMet());
 
AddRecordEx(pRecord);   <-- this crashes (invalid index on InsertAt())
 
Here's the call stack:
 
  ntdll.dll!7c911230()  
  msvcr71d.dll!_CrtDbgBreak()  Zeile 93 C
  msvcr71d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x01a44038, int nLine=549, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...)  Zeile 427 C
  mfc71d.dll!AfxAssertFailedLine(const char * lpszFileName=0x01a44038, int nLine=549)  Zeile 28 + 0x14 C++
  ToolkitPro1122vc71D.dll!CArray<CXTPReportRow *,CXTPReportRow *>::InsertAt(int nIndex=-1, CXTPReportRow * newElement=0x060e51a8, int nCount=1)  Zeile 549 + 0x15 C++
  ToolkitPro1122vc71D.dll!CXTPReportRows::InsertAt(int nIndex=-1, CXTPReportRow * pRow=0x060e51a8)  Zeile 133 C++
  ToolkitPro1122vc71D.dll!CXTPReportControl::InsertRow(int nIndex=-1, CXTPReportRow * pRow=0x060e51a8)  Zeile 882 + 0x21 C++
> ToolkitPro1122vc71D.dll!CXTPReportControl::AddRecordEx(CXTPReportRecord * pRecord=0x060e4988, CXTPReportRecord * pParentRecord=0x00000000, int nChildIndex=-1)  Zeile 1517 + 0x4c C++
  XRVisualizer.exe!CStateReportCtrl::AppendRecordEx(double rtFrom=1198247099.0100000, double rtTo=-1.7976931348623157e+308, double rtOnlineTimestamp=1198247176.1480000, const char * lpEvtCatLbl=0x04bfdf00, long rtResID=1, long lPriority=1079, const char * lpMsg=0x04bfbbb0, const char * lpszOrderNumber=0x04bfdf34, const char * lpszProduct=0x04bfdf50, const char * lpszEmployee=0x04bfdf6c, unsigned long clrFore=16777215, unsigned long clrBack=51200, bool bSucceedingError=false, bool bDelimiter=false)  Zeile 277 + 0x18 C++
Rest skipped...
 
---------------------
 
I tried in vain to find any samples showing the AddRecordEx()/RemoveRecordEx() in Codejock samples folder, so any help is very welcome!
The toolkit version I use is 11.2.2. 
 
 


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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