Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to add record on the fly w/o Populate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to add record on the fly w/o Populate

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: How to add record on the fly w/o Populate
    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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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.125 seconds.