TargetPDF Object

SQL*XL
home

Class clsTargetPDF is a subclass of:

Target

Description:

The TargetPDF object implements the functionality to output data from SQL*XL to a PDF file. The properties of TargetPDF determine the way data is output to the PDF file. To obtain a reference to the targetPDF object use the Targets property of the SQLXL object. Example: SQLXL.Targets( litPDF ).Headings = False

Physically, output is generated by the Statement objects notably the StmtDQL object that implements select statements. The execute method of the Statement outputs the data according to the setting of the Target property on the Statement. If Statement.Target = litPDF then output will be generated in a PDF file.

Properties:

Name Data Type Description
FileName As String File name for the resulting pdf file (full path name!)
Headings As Boolean Print column headings
FitWidth As Boolean Makes the width of the pdf file large enough to fit the contents.

 

Example:

Create output to PDF:


SQLXL.SQL.setText Text := "select * from emp"
Set SQLSL.SQL.Statements(1).Target=Targets(litPDF )
Targets(litPDF).FileName = "c:\test.pdf"
Targets(litPDF).Headings = True
SQLXL.SQL.Statements(1).Execute

Note: Please record all code through the macro recorder.