PRINT reportname ARRANGE clause WHERE clause .. ORDER BY clause .. OPTION XLS
Note: Each additional OPTION parameter must be separated by the pipe | symbol.
IMPORTANT: When printing to the XLS format, the report objects must be spaced apart appropriately or "padded" in order for the report data to appear correctly in the Excel report output. Experimenting with vertical and horizontal will also allow you to attain your desired output. Also, please refrain from using elaborate fonts that may not be supported within Excel.
OPTION Parameters:
FILENAME specifies the full path and filename. If no path is defined, output will be saved in the current working directory.
SHOW_CANCEL_DIALOG specifies whether to suppress cancel dialog box during the print process.
Values:
ALL_TEXT_IN_GENERAL_FORMAT Specifies whether all the text in the report should be converted to general format or the format of the text should be detected and encoded accordingly.
Vales:
Set ALL_TEXT_IN_GENERAL_FORMAT to ON to encode all the text contents in the report in general format. General format text have no specific number format. Set ALL_TEXT_IN_GENERAL_FORMAT to OFF to detect the format of the text and encode accordingly. In this case number and other formats are identified and encoded.
CELL_ATTR Cell attributes include shading of the cell whose color is not WHITE.
Values:
INCLUDE_IMAGES specifies whether Image objects on the report should be included in the exported file.
Values:
IMAGE_FORMAT specifies the Linked image file format for image controls used in the report.
Values:
INCLUDE_LINES specifies whether lines on the report should be included in the exported file.
Values:
INCLUDE_RICH_TEXT specifies whether contents of the RichText objects on the report should be included in the exported file.
Values:
RICHTEXT_ENCODING_TYPE indicates the way in which RichText contents should be encoded in Excel document.
Values:
Set RICHTEXT_ENCODING_TYPE to IMAGE to encode RichText contents as exact graphical representations. Set RICHTEXT_ENCODING_TYPE to PLAINTEXT to encode RichText contents as unformatted text. The font used when encoding RichText as plain text is the one set in the Font property of the RichText object. When RICHTEXT_ENCODING_TYPE is set to PLAINTEXT make sure you set the Default Font property of the RichText control in report designer to true and set the required font in the Font property.
INCLUDE_SHAPES specifies whether shapes on the report should be included in the exported file.
Values:
LINE_SPACE specifies the spacing to be used between lines of text.
Values:
ONE_SHEET_PER_PAGE specifies whether each page in the report should be encoded into separate excel sheets or all the pages should be encoded in a single excel sheet.
Values:
OPEN specifies whether the report should be opened after it is generated.
Values:
EMAIL specifies the report output (defined as FILENAME filename.ext ) to be sent via e-mail as an attachment.
Values:
See additional options when EMAIL value is set to ON. EMAIL SET ON
Example:
Example 01 (To print Invoices as XLS file)
PRINT Invoice WHERE CustID = 127 +
OPTION XLS +
|FILENAME Invoice.XLS +
|SHOW_CANCEL_DIALOG OFF +
|ALL_TEXT_IN_GENERAL_FORMAT OFF +
|CELL_ATTR ON +
|INCLUDE_IMAGES OFF +
|INCLUDE_LINES OFF +
|INCLUDE_RICH_TEXT ON +
|RICHTEXT_ENCODING_TYPE IMAGE +
|INCLUDE_SHAPES OFF +
|LINE_SPACE ACTUAL +
|ONE_SHEET_PER_PAGE ON +
|OPEN ON
RETURN
For more examples and templates, please refer to R:Docs (version 2.5 or higher).