ComponentOne VSView 8.0
RenderControl Property

Renders an OPP-enabled control (such as the VSFlexGrid) on the page.

Syntax

[form!]VSPrinter.RenderControl = value As Long

Remarks

To render an OPP (Open Printing Protocol) enabled control on a page, assign its window handle (hWnd property) to the RenderControl property.

The ComponentOne VSFlexGrid control supports OPP and can be rendered using the RenderControl property.  For example, the following code renders three grids onto a report, with titles above each one:

With vp

  .StartDoc

 

  .Paragraph = "Here is the list of customers:"

  .RenderControl = VSFlexGridCustomers.hWnd

 

  .Paragraph = "Here is the list of suppliers:"

  .RenderControl = VSFlexGridSuppliers.hWnd

 

  .Paragraph = "Here is the list of products:"

  .RenderControl = VSFlexGridProducts.hWnd

 

  .EndDoc

End With

Using the RenderControl property to print a control has the following advantages over other approaches (such as PrintForm):

1.   RenderControl leverages all VSPrinter's capabilities, including previewing, the ability to add custom headers and footers, margin control, and so on.

2.   The control is incorporated into a document. This means you can render multiple controls into a document, add annotations, pictures, charts and so on.

3.   RenderControl supports spanning pages both vertically and horizontally. (Grid controls often spill sideways as well as down.)

4.   The VSPrinter only provides the drawing context, but the control is responsible for rendering itself. Thus, the final image is completely accurate.

5.   Rendering a control on a page takes only one line of code.

Data Type

Long

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback