Print Page | Close Window

Using CXTPReportRows::ReserveSize

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=8222
Printed Date: 22 November 2024 at 1:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using CXTPReportRows::ReserveSize
Posted By: markr
Subject: Using CXTPReportRows::ReserveSize
Date 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.



Replies:
Posted By: sserge
Date 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



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