Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Using CXTPReportRows::ReserveSize
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using CXTPReportRows::ReserveSize

 Post Reply Post Reply
Author
Message
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Topic: Using CXTPReportRows::ReserveSize
    Posted: 29 September 2007 at 2:58pm
Hello,

I see that a new optimization method, CXTPReportRows::ReserveSize, has been added to the report control for the 11.2 release. Could someone provide "best practices" for how this should be used?

In our case, we add records to the control on the fly, then call Populate(). So my assumption is that I should call ReserveSize(N) right before I call Populate() - where N is the number of records added in previous steps.

This is correct usage, or is there a better way?

P.S. - I am not using virtual mode.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2007 at 6:39pm
Hi,

If you use a significant number of records with your Report control, you can simply enable new optimization features:

 CXTPReportControl::UseReportCustomHeap();
 CXTPReportControl::UseRowBatchAllocation();


Some methods like CXTPReportRows::ReserveSize, related to recently added optimization bunch, are public and you can use them if feel helpful.

CXTPReportRows::ReserveSize works similar to CArray::SetSize -- it prevents adding elements to your array with frequently memory reallocation (which then causes memory fragmentation).

--
WBR,
Serge
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.109 seconds.