ComponentOne VSView 8.0
ExportFile Property

Returns or sets the name of an export file of type defined by the ExportFormat property.

Syntax

[form!]VSPrinter.ExportFile[ = value As String ]

Remarks

The ExportFile property works in conjunction with the ExportFormat property to generate HTML or RTF output from VSPrinter documents.

If the ExportFile property is set to a valid file name when a document is started with the StartDoc method, the VSPrinter control will generate an export file by that name. The export file will contain HTML or RTF code, depending on the setting of the ExportFormat property. The export file is closed when the EndDoc method is invoked.

The following code shows how you can use the same code to generate regular output, HTML, or RTF files:

Private Sub CreateDocument(sFile As String)

With vp

' set up to export RTF, HTML, or nothing

.ExportFile = ""

If Instr(sFile, ".rtf") Then

.ExportFile = sFile

.ExportFormat = vpxRTF

ElseIf Instr(sFile, ".htm") Then

.ExportFile = sFile

.ExportFormat = vpxDHTML

End If

' create document

.StartDoc

CreateDocumentBody

.EndDoc

' clear ExportFile to avoid overwriting it

.ExportFile = ""

End Sub

For a complete example, see the VSPrinter Tutorial - Calendar topic.

Notes:

· Not all elements placed in a document can be translated into HTML or RTF. Graphical objects, text boxes, headers, footers will not translate, nor will RTF text translate into HTML. Most other elements will, including regular text, paragraphs, tables, and all character formatting.

· You cannot export a document after it has been created. The output must be generated while the document is being created.

· Remember to reset the ExportFile property when you are done creating each document, to avoid accidentally overwriting the file.

· For safety reasons, this property is disabled when the control is hosted on a Web page.

Data Type

String

 

 


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

Product Support Forum  |  Documentation Feedback