General Usage

<< Click to Display Table of Contents >>

Navigation:  How To Use the VPE Control > VPE .NET Control >

General Usage

Previous pageReturn to chapter overviewNext page

The Winforms .NET Control, is based on the Winforms classes and should be used for GUI applications. It provides a preview window and related methods / properties.

VPE also includes a .NET WebServerControl (VpeWebControl) for use with ASP.NET. The control is a subset of the Winforms .NET Control. It does not have any events, properties or methods which are related to the graphical user interface (GUI) of VPE, since it is intended solely to be executed on servers within ASP.NET and therefore does not provide a GUI. All events, properties and methods not supported by the VpeWebControl are marked throughout this manual.

 

The common sequence of function calls is:

Set the properties for behavior and appearance of VPE in the design mode or during runtime before calling the method OpenDoc()

Open a document with the method "OpenDoc

Use all possible methods to insert VPE objects (like Write(), etc.)

Use "PageBreak” to generate new pages

Use "Preview” to show the preview to the user, this is optional

Use "PrintDoc” to print the document, or WriteDoc() to export it

Close the document with "CloseDoc

 

It is only possible to open one document per VPE-Control. If you want to open multiple documents simultaneously, you need to place the same number of VPE-Controls on the form.

 

Example for Visual Basic .NET, which can be easily translated to other programming languages:

The following example assumes that you use a VPE .NET Control object named "Report".

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 Report.OpenDoc()

 Report.Print(1, 1, "Hello World!")

 Report.Preview()

End Sub

 

This example is very simple. The document is opened, the text "Hello World!" is inserted at position (1, 1) and afterwards the preview is shown.

 

For a detailed explanation of the basic programming techniques, please continue reading in the "Programmer's Manual" chapter 4 "Programming Techniques".