0% found this document useful (0 votes)
7 views5 pages

Ole EN

The document outlines the use of the OLE interface of Akewa, detailing methods for document, printer, printing, dynamic fields, database, and preview management. It provides specific function calls for opening and closing documents, managing printers, printing documents, handling dynamic data, and previewing outputs. Additionally, it includes remarks and examples for effectively utilizing the interface in various scenarios.

Uploaded by

microshop.h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Ole EN

The document outlines the use of the OLE interface of Akewa, detailing methods for document, printer, printing, dynamic fields, database, and preview management. It provides specific function calls for opening and closing documents, managing printers, printing documents, handling dynamic data, and previewing outputs. Additionally, it includes remarks and examples for effectively utilizing the interface in various scenarios.

Uploaded by

microshop.h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 5

Use of the interface OLE of Akewa

Create interface

There are two ways of referring the interface by employing a variant or a typefied variable
(importation obligatory of the Akewa TLB in this case).

Document management

Interface.OpenDocument (BSTR DocName) : return a VARIANT_BOOL


Open a document. If the operation failed return "False"

Interface.CloseDocument (BSTR DocName) : return a VARIANT_BOOL


Close a document. If the operation failed return "False"

Interface.CloseAll
Close all opened documents

Interface.OpenDocumentsCount : return a int


Return the number of opened documents

Interface.OpenDocuments[int Index] : return a BSTR


Return the name an opened document (Index of 0..OpenDocumentsCount - 1)

Interface.DefaultDocumentDir : return a BSTR


Return the document directory defined in akewa

Interface.ActiveDocument : return or get a BSTR


Return or set the active document (the document must be open)

Interface.CurrentFormat : return a BSTR


Return the name of active document format

Interface.FormatType[BSTR DocName] : return a TFormatType


Return the type document format « DocName »

Remarks :
The activation an already active document does not invoke any action.
Avoid closing a document if it must be re-used.
If documents to be opened are known when start the application it is preferable to open the
whole documents at start, all documents will be released when the interface will be closed. In
a general way avoid to open and close in your loops treatment (optimisation).

Printer management

Interface.GetPrinterPortDetail (BSTR DeviceName) : return a BSTR


Return information on the printer

Interface.PrinterPortsCount : return a int


Return the number of printers available by akewa

Interface.PrinterPorts[int Index] : return a BSTR


Return the printer name (Index of 0.. PrinterPortsCount - 1)

Interface.PrinterPort : return or get a int


Return or set the current printer index

Interface.CurrentPrinter : return a BSTR


Return the current printer name

Interface.PrinterSetup (int Index)


Opening setup printer by "Index"

Interface.PrintOutPutFile : return or receives a BSTR


Set the output file name (Windows printers)

Remarks:
When you open a document, the dependent printer becomes the current printer. The
selection of the printer already selected does not invoke any action.

Printing management

Interface.SmartPrint : return a VARIANT_BOOL


Run the active document printing

Interface.Print (BSTR Dest, int Quantity, BSTR OutPutFile) : return a


VARIANT_BOOL
Run the printing of the active document on the printer « Dest », with a quantity « Quantity »
and output in the file « OutPutFile » (empty for direct output)

Interface.PrintQuantity : return or get a int


Set the document quantity to be printed

Interface.UseInputForm : return or get a VARIANT_BOOL


Set the use of the form

Interface.InputFormMode : return or get a TInputFormMode


Set the opening form mode

Interface.EncodeTracks : get a VARIANT_BOOL


Set the track encoding

Interface.PrintVerso : get a VARIANT_BOOL


Set the back printing

Interface.PrintRecto : get a VARIANT_BOOL


Set the front printing

Dynamic fields management

Interface.IndexOfDataName (BSTR DataName) : return a int


Return the variable data « DataName » index

Interface.DataCount : return a int


Return on the active document the number of variable data.

Interface.DataNames[int Index] : return a BSTR


Return the variable data name set by "Index"

Interface.DataValues[int Index] : return or get a BSTR


Return or set the variable data value set by "Index"

Interface.BeginDataSession (int Index)


Start a session of data for the document "Index", all the orders of printing are not sent to the
printer, datas are gathered

Interface.EndDataSession
End active document information session, printing is carried out by using all the information
since the BeginDataSession call

Remarks:
BeginDataSession and EndDataSession are not useful only for "Multiple" or "page" document
formats.

Database management

Interface.DataFilter : return or get a int


Return or set the filter index to use

Interface.DataFiltersCount : return a int


Return the number of available filters

Interface.DataFilters[int Index] : return a BSTR


Return the filter name give by "Index" (Index of 0..DataFilterCount -1)

Interface.DataIndex : return or get a Int


Return or set the indice of index to use

Interface.DataIndexCount : return a int


Return the number available indices

Interface.DataIndexs[int Index] : return a BSTR


Return the index name set by "Index" (Index of 0.. DataIndexCount -1)

Interface.PrintMethod : return or get a TPrintMethod


Return or set the database extract method

Interface.PrintParam : return or get a BSTR


Return or set the filter or the index to use

Interface.PrintParamType : return or get a TPrintParamType


Return or set the parameter type to use

Interface.PrintQuantityIsDataField : return or get a VARIANT_BOOL


Return or set the @QTY to use

Interface.PrintQuantityIsLimited : return or get a VARIANT_BOOL


Return or set the limit of quantity to use

Preview management

Interface.PreviewMode : return or get a TPreviewMode


Return or set the preview mode either with akewa preview form or with a bitmap file or
Windows clipboard

Interface.PreviewFileName (BSTR FileName)


Set the bitmap file name to use for the preview

Interface.PreviewStart : return a int


Start the preview and return the page number

Interface.PreviewPrev : return a VARIANT_BOOL


Preceding page. Return "True" if first page else "False"

Interface.PreviewNext : return a VARIANT_BOOL


Following page. Return "True" if last page else "False"
Interface.PreviewZoom (int Zoom)
Change the preview zoom

Interface.PreviewSide (int Side)


Change the preview face (0 = Front, 1 = Back)

Interface.PreviewStop
Stop the preview

Remarks:
PreviewPrev, PreviewNext, PreviewZoom are used in mode file or clipboard, PreviewFileName
is used only with mode. file
The update of the file or the clipboard is carried out after the call of PreviewStart,
PreviewPrev, PreviewNext, PreviewZoom, the destruction of the file must be carried out by
the application.

Other functions

Interface.WorkDir : return a BSTR


Return the akewa install directory

Interface.DefaultReset
Set default value

Interface.OpenForm (BSTR FileName)


Run a customized formulary

Use example

Simple case:

Create interface.
2. Open documents. (OpenDocument)

If several document must to be print, repeat the actions 3..8.


3. Activation an open document. (ActiveDocument)
4. Select the printer. (PrinterPort)
5. Set the quantity. (PrintQuantity)
6. Set the database parameters.
7. Set the variable data values. (DataValues)
8. Print. (SmartPrint)

9. Close the open documents. (CloseDocument or CloseAll)

Use "BeginDataSession" and "EndDataSession":

This operating mode is useful only for the multiple format or page.
10. Create interface.
11. Open documents. (OpenDocument)

If several document must be printed, repeat the actions 3.


12. Starting the information sessions for each document (BeginDataSession).

If several document must to be print, repeat the actions 4..9.


13. Activation an open document. (ActiveDocument)
14. Select printer (useless in the Windows printers case).
15. Set the quantity. (PrintQuantity)
16. Set the database parameters.
17. Set the variable data values. (DataValues)
18. Print. (SmartPrint)

When all the information is carried out, you can close.


If several document must to be print, repeat the actions 10..12.
19. Activation an open document. (ActiveDocument)
20. Select printer (obligatory).
21. Close the information session (EndDataSession).

22. Close the open documents. (CloseDocument or CloseAll)

Use preview :

1. Define the operating mode. (PreviewMode)

Mode with akewa preview form:

23. Start preview (PreviewStart)

Mode bitmap file or Windows clipboard :

2. Set the file name (PreviewFileName if bitmap mode)


3. Start preview (PreviewStart)
4. To navigate in various pages (PreviewPrev, PreviewNext, PreviewZoom, PreviewSide)

For all modes it is necessary to close the preview (PreviewStop)

You might also like