At 10:38 AM 2/16/2009, Bill Eyring wrote:
I've spent my Presidents Day weekend perplexed and dismayed
by a problem I have printing a simple report to a pdf file.
Without knowing all details, try the following very simple
example that concatenates the DATE without mucking with the
date format to create a PDF file name.
Steps:
01. Create a file with the following code (copy and paste)
02. Place the file in RRBYW14 folder
03. Run the file and see what you get
Have fun!
Very Best R:egards,
Razzak.
-- Example:
-- Concatenating the report name and date to create a PDF file name
-- start here
LABEL Start
IF (CVAL('DATABASE')) <> 'RRBYW14' OR (CVAL('DATABASE')) IS NULL THEN
CONNECT RRBYW14 IDENTIFIED BY NONE
ENDIF
-- Define the FileName
CLEAR VAR vFileName
SET VAR vFileName TEXT = +
('SalesSumAndSubTotals_'+(FORMAT(.#DATE,'MMDDYYYY'))+'.PDF')
-- Verify the existence of PDF Sub-Directory
SET VAR vChkFile INTEGER = NULL
SET VAR vChkFile = (CHKFILE('PDF'))
IF vChkFile <> 1 THEN
MD PDF
ENDIF
CLS
PRINT SalesSumAndSubTot +
OPTION PDF +
|FILENAME PDF\.vFileName +
|SHOW_CANCEL_DIALOG ON +
|BACKGROUND_FILE NONE +
|BACKGROUND_TYPE CENTER +
|BACKGROUND_COLOR WHITE +
|INCLUDE_LINES ON +
|INCLUDE_SHAPES ON +
|INCLUDE_RICHTEXT ON +
|RICHTEXT_ENCODING_TYPE PLAINTEXT +
|INCLUDE_IMAGES ON +
|IMAGE_FORMAT JPG +
|PIXELFORMAT 32 +
|JPEG_QUALITY 100 +
|IMAGE_DPI -1 +
|INCLUDE_HYPERLINKS ON +
|GENERATE_TOC ON +
|TITLE Customer Sales Sub-Totals and Totals +
|SUBJECT Sales Summary Report +
|AUTHOR Accounting Team of Consolidated Computer Company +
|KEYWORDS SubTotals Totals Sales Summary +
|USE_COMPRESSION ON +
|COMPRESSION_METHOD MAXCOMPRESS +
|FONT_ENCODING WIN_ANSI +
|EMBED_USED_FONTS ON +
|OPEN ON
LABEL Done
CLEAR VARIABLES RBTI_%,vFileName,vChkFile
RETURN
-- end here