Razzak,

Thanks for calling attention to undocumented features of the FORMAT function.  
At one time way back when either in old documentation or in a discussion post 
the syntax to format DATE and TIME variables was mentioned.  If you access the 
SET DATE and SET TIME commands you will find such key words as MMM, MMM+, MM, 
DD, YY, YYYY, HH, MM (for time ), SS, AP, etc. that can be used in the FORMAT 
function.  Also, note that the recent implimentation of "NN" as a replacement 
for "MM" in time allows you to format DATETIME values. 

Jim Bentley

American Celiac Society

[email protected]

tel: 1-504-737-3293

--- On Mon, 2/16/09, A. Razzak Memon <[email protected]> wrote:
From: A. Razzak Memon <[email protected]>
Subject: [RBASE-L] - Re: Problem printing to PDF file
To: "RBASE-L Mailing List" <[email protected]>
Date: Monday, February 16, 2009, 10:52 AM

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 




      

Reply via email to