60000698 New method to set the document in BaseControl

Article 60000698
Type Wish
Product Engine
Version 6013
Date Added 11/25/2008 12:00:00 AM
Fixed (11/25/2008 12:00:00 AM)
Submitted by Kostas Christodoulou

Summary

Is there a method to set the document in a "empty" BaseControl (vdFramed/vdScrollable) from an already "calculated" in the background vdDocument component ?

Solution

In version 6.1014 there is a new method exported in the Base control, SetActiveDocument in which you can pas a document from another component. Note that you should be cautious with this method and the way you use the document as this document is referenced (byref) to the BaseControl so any change in the document in the Basecontrol (target) or the vdDocument component (source) will impact both. The document is like shared between the two controls.

If you don't want the document to be shared like this then you should use the ToStream & LoadFromMemory methods (see article 60000414 for a how-to) or use the MargeTables method , like :
     DOC-Target.New();
     DOC-Target.MergeTables(DOC-Source, True, True); // DOC-Target and DOC-Source are vdDocument objects.

Send comments on this topic.