<OBJECT>.SAVEAS()
Syntax
Output_Filename as C = : Object_Type.SAVEAS( Layout_Name as C [, Format as C [, Filter_Expression as C [, Order_Expression as C [, Output_Filename as C [, Open_Application as L [, PrintOptions as P [, Arguments as SQL::Arguments ]]]]]]] )
|
Argument |
|
Description |
|
|
Object_Type |
V5 |
This word can be any of the following:
|
|
|
Layout_Name |
V5 |
The name of a form, browse, label, letter, or report layout. |
|
|
Format |
V5 |
Optional. Default = "PDF". The options for Format are: |
|
|
Format |
File Type | ||
|
"PDF" |
Adobe Acrobat PDF Format.
| ||
|
"HTML" |
Dynamic HTML | ||
|
"RTF" |
Rich Text Format | ||
|
"TXT" |
Plain Text Format | ||
|
Filter_Expression |
V5 |
Optional. Default = ".T." (All records). A character filter expression that evaluates to a logical value and selects records from the table. |
|
|
Order_Expression |
V5 |
Optional. Default = record order. A character order expression that sorts selected records. |
|
|
Output_Filename |
V5 |
Optional. Default = Layout_Name in the same folder as the database. The path and name to give the saved file. |
|
|
Open_Application |
V5 |
Optional. Default = .F. (FALSE). .T. = After the layout is printed, Alpha Five opens the file with its associated applications. For example, if you saved as a Rich Text Format file, and WordPerfect is the associated application for .RTF files on your computer, Alpha Five will start WordPerfect and load the file. .F. = Do not open associated application. |
|
|
PrintOptions |
V7 |
Optional. Default = NULL. You can override the
default system settings on a permanent basis. When you override the system
defaults, your settings are stored in a text file in the Alpha Five program
folder. These files are named: For more information about print options. |
|
|
Arguments |
V7 |
Optional. Default = NULL_VALUE(). Arguments that retrieve value(s) from variable(s) or prompts for value(s) at runtime. Only applicable to SQL Reports. Refer to SQL::Arguments Object. |
|
|
Options |
V7 |
Optional. Default = NULL_VALUE(). Sets filter (WHERE) and order (ORDER BY) expressions for a query against a passive-linked table. A pointer dot variable with 2 elements. Refer to Using the Options Argument.
|
|
Description
The <OBJECT>.SAVEAS() method prints Layout_Name to file in PDF, HTML, RTF, or TXT formats. If no format is specified, the .PDF format is used.
If you specify an optional Filter_Expression, the only records matching the filter are printed. (In addition to the filter specified here, the layout may have a filter defined within the layout definition).
The layout is printed to Filename. If Filename is not specified, the layout is printed to a file with the same name as the Layout_Name in the same folder as the database.
Supported By
Alpha Five Version 5 and Above
Limitations
Desktop applications only.
Examples
This script saves a report as a RTF file.
|
filename = :Report.saveas("Invoice","rtf") |
This script saves a report as a PDF file, then launches Adobe Acrobat to view it.
|
dim fn as C fn = report.saveas("Customer List", "PDF", "", "", "C:\test.pdf", .T.) |
This script saves copy of the Invoice report with an argument. You can add as many arguments to the arguments collection as you want.
|
DIM myargs as SQL::arguments |
|
Option |
Type |
Default |
|
PrintOptions.Concatenate |
L |
.F. |
|
PrintOptions.HasWatermark |
L |
.F. |
|
PrintOptions.MultilingualSupport |
L |
.F. |
|
PrintOptions.LinearizeForWeb |
L |
.F. |
|
PrintOptions.Colors2GrayScale |
L |
.F. |
|
PrintOptions.ConvertHyperlinks |
L |
.F. |
|
PrintOptions.WatermarkType |
C |
"Text" |
|
PrintOptions.WatermarkText |
C |
"D R A F T" |
|
PrintOptions.WatermarkFontName |
C |
"Times New Roman" |
|
PrintOptions.WatermarkFontSize |
N |
172 |
|
PrintOptions.WatermarkRotation |
N |
450 |
|
PrintOptions.WatermarkColorHex |
C |
upper("e8fed2") |
|
PrintOptions.WatermarkHorizPos |
N |
120 |
|
PrintOptions.WatermarkVertPos |
N |
120 |
|
PrintOptions.WatermarkOnTop |
L |
.F. |
|
PrintOptions.WatermarkPDF |
C |
"" |
|
PrintOptions.Encrypt |
L |
.F. |
|
PrintOptions.OwnerPassword |
C |
"" |
|
PrintOptions.UserPassword |
C |
"" |
|
PrintOptions.CanPrint |
L |
.T. |
|
PrintOptions.CanModifyDocument |
L |
.T. |
|
PrintOptions.CanCopy |
L |
.T. |
|
PrintOptions.CanAddNotes |
L |
.T. |
|
PrintOptions.Use128BitKey |
L |
.F. |
RTF PrintOptions
|
Option |
Type |
Default |
|
PrintOptions.MultilingualSupport |
L |
.F. |
|
PrintOptions.Colors2GrayScale |
L |
.F. |
|
PrintOptions.RTFType |
C |
"Formatted Text" |
HTML PrintOptions
|
Option |
Type |
Default |
|
PrintOptions.MultilingualSupport |
L |
.F. |
|
PrintOptions.Colors2GrayScale |
L |
.F. |
|
PrintOptions.ConvertHyperlinks |
C |
.F. |
|
PrintOptions.HTMType |
C |
"Layers" |
See Also
Form Functions and Methods, Browse Functions and Methods, Writing Expressions