TOleanderController Methods

Check
Declaration
procedure Check;
Description

The Check method scans the document specified in the Docname property of the associated OleanderPrinter. It will try to resolve every identifier it can find. To do this it will try to locate all active datasources on the form it is on and every active datasource specified in the AdditionalSources property.

If the controller can not find the proper datasource and field, it will ask the application with the OnIdentifierCheck event if it will handle this identifier. If the application does not know the identifier either, the controller assumes an error an raises an exception.

Also will be checked:

 

Close
Declaration
procedure Close;
Description

The Close method closes the OleanderController and the associated OleanderPrinter.

 

Create
Declaration
constructor Create(AOwner: TComponent);
Description

The Create method allocates memory to create the component and initializes its data as needed. Each object can have a Create method customized to create that particular kind of object. The owner of the created component is passed in the AOwner parameter.

Usually you don't need to create objects manually. Objects you design in Delphi are automatically created for you when you run the application and destroyed when you close the application.

If you construct a component by calling Create, and give it an owner, the owner disposes of the component when the owner is destroyed. If you don't want another component to own the created component, pass Self in the AOwner parameter.

 

Destroy
Declaration
destructor Destroy;
Description

The Destroy method destroys the object, component, or control and releases the memory allocated to it.

You seldom need to call Destroy. Objects designed with Delphi create and destroy themselves as needed, so you don't have to worry about it. If you construct an object by calling the Create method, you should call Free to release memory and dispose of the object. Free checks to see if the pointer is nil before calling Destroy and is also more efficient in code size.

 

Open
Declaration
procedure Open;
Description

The Open method enables the OleanderController. It checks if a valid Datasource and OleanderPrinter are assigned. If so, the OleanderPrinter will be activated, too.

 

Print
Declaration
procedure Print (APreview: boolean);
Description

The Print method prints the document specified in the Docname property of the associated OleanderPrinter for every record it finds in the Datasource property. If there are no bookmarks in the Bookmarks property Oleander will loop the dataset specified in the Datasource property from First to EOF. If there are bookmarks, every bookmark will be selected and printed.

Prior to printing, the Check method will be called.

If the APreview parameter is False, the resulting document will be sent to the printer, the original and the resulting document will be freed.

If the APreview parameter is True, the resulting document will not be sent to the printer nor freed. Instead the OLE server will be activated setting the ShowServer property of the associated OleanderPrinter to TRUE. The print method will then return to the calling application for further processing. The resulting document can be printed with a call to the PrintDoc method of the OleanderPrinter.