Prod.: Engine, ver.: 6013, ID: 60000698, Wish : New method to set the document in BaseControl

Wish : New method to set the document in BaseControl

Article60000698
TypeWish
ProductEngine
Version6013
Date Added11/25/2008
FixedYes [11/25/2008]
Submitted byKostas Christodoulou
Keywords

Subject

New method to set the document in BaseControl

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.