Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Update a record without Populate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Update a record without Populate

 Post Reply Post Reply
Author
Message Reverse Sort Order
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Update a record without Populate
    Posted: 15 September 2008 at 5:18am
I also have problems with CXTPReportControl::UpdateRecord(), in XTP 12.0.1. After I have called it, I get a crash as soon as CXTPReportRecords::RemoveAll() is called.
 
Is this a known issue or am I doing anything wrong?
 
CMyRecord *pRecord = wndReport.GetRecords()->GetAt(0);
pRecord->DoStuff();
wndReport.UpdateRecord(pRecord, FALSE);
 
And later the report is re-populated, causing a crash:
wndReport.ResetContent();
...
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 8:27am
UpdateRecord does not desroy/recreate existing collections.
Internally it calls
  RemoveRecordEx
  AddRecordEx
 
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 7:26am
Hi Andrei,
 
If you are going to fix this, will it affect the rest of ReportControl? I mean when calling .populate some (internal) collections will be destroyed (some I know, not all...)
  • Expanded/collapsed groups
  • Selected rows
  • .... maybe more

Does this .UpdateRecord method do the same or will it only be applied on that record?

 
Thanks 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2008 at 11:10am
Hi,
I find a bug.
Will be fixed in 12.0.2
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2008 at 9:30am
Hi,
 
Can I do this?:
 
    PhysicalMemory = GetPhysicalMemory() / 1000000
    FreePhysicalMemory = GetFreePhysicalMemory() / 1000
    
    Dim record As XtremeReportControl.ReportRecord
    Set record = wndReportControlStatus.Records(0) 
          record.Item(1).Value = PhysicalMemory & " Mb"
    wndReportControlStatus.UpdateRecord record, False
    
    Set record = wndReportControlStatus.Records(1)
          record.Item(1).Value = FreePhysicalMemory & " Mb"
    wndReportControlStatus.UpdateRecord record, False
    
    or
    
    wndReportControlStatus.Records(0).Item(1).Value = PhysicalMemory & " Mb"
    wndReportControlStatus.UpdateRecord wndReportControlStatus.Records(0), False
    wndReportControlStatus.Records(1).Item(1).Value = FreePhysicalMemory & " Mb"
    wndReportControlStatus.UpdateRecord wndReportControlStatus.Records(1), False
 
 
both will mess up the first reportitems of records
 
I will try to create a test project for this later on
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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.186 seconds.