At 10:30 PM 2/5/2010, Tom Frederick wrote:
I know the PDFs sub on Y:\ exists because I initially set it up
that way. I have write permits to Y:\and all the subs. I will
try the &vFileName option tommorrow. There is probably a single
letter I am missing. Looking at the EEP long enough and the
details slide by. I have a 100+ samples of this working on C:\
every time, so I know the basic idea works. Since the filenames
go the right places on the network there has to be something
blocking the creation of the text part of the file. Time to step
away for awhile.
SET VAR vCurrDir TEXT = ((CVAL('CurrDir'))+'\PDFs\')
SET VAR vRep TEXT = 'MHA'
SET VAR vRepTitle TEXT = +
((CTXT(.vZID))+'_'+.vRep+'_'+.vStDate+'_'+.vStTime+'.PDF')
SET VAR vFileName TEXT = (.vCurrDir + .vRepTitle)
PRINT Mental_Health_Assemment WHERE ZID = (.vZID) +
OPTION PDF +
|FILENAME .vFileName +
edited 20 lines out
|OPEN OFF
Tom,
You need to take a close look at the concatenated string that
results in "vFileName".
Can you post the result of vFileName variable?
Looking closely at the expression for vRepTitle above, I see
the inclusion of vStDate and vStTime. Assuming the Date and
Time, you will have to use the FORMAT option to add everything
as TEXT to build the whole string as TEXT, without slashes "/"
in DATE and colons ":" in TIME.
Technically, to always create the PDF file in a sub-folder,
such as "PDF", try the following simplified code and see
what you get.
-- Start
-- Pre-Defined Global Variables
SET VAR vPause2Message TEXT = NULL
SET VAR vChkFile INTEGER = NULL
SET VAR vFileName TEXT = NULL
SET VAR vStDate DATE = .#DATE
SET VAR vStTime TIME = .#TIME
SET VAR vRep TEXT = 'MHA'
SET VAR vZID INTEGER = 1000
-- Check the existence of PDF file
SET VAR vChkFile = (CHKFILE('PDF'))
IF vChkFile <> 1 THEN
MD PDF
ENDIF
-- Define PDF Report File Name (all in one string)
SET VAR vFileName = +
('PDF\'+(CTXT(.vZID))+'_'+.vRep+'_'+(FORMAT(.vStDate,'YYYYMMDD'))+ +
'_'+(FORMAT(.vStTime,'HHMMSS'))+'.PDF')
-- Now Print Report
PRINT Mental_Health_Assemment WHERE ZID = .vZID +
OPTION PDF +
|FILENAME .vFileName +
|SHOW_CANCEL_DIALOG OFF +
|GENERATE_TOC OFF +
|TITLE your title here ... +
|SUBJECT Mental Health Assessment +
|AUTHOR Your name here ... +
|KEYWORDS Mental Health Assessment +
|OPEN OFF
-- Provide Details for End User
CLS
SET VAR vPause2Message = +
('PDF file'&.vFileName&'created successfully!')
PAUSE 2 USING .vPause2Message +
CAPTION ' Mental Health Assessment Report' +
ICON CONFIRM +
BUTTON 'Press any key to continue ...' +
OPTION BACK_COLOR WHITE +
|MESSAGE_COLOR WHITE +
|MESSAGE_FONT_NAME VERDANA +
|MESSAGE_FONT_SIZE 10 +
|MESSAGE_FONT_COLOR GREEN +
|MESSAGE_FONT_BOLD OFF +
|BUTTON_COLOR WHITE +
|BUTTON_FONT_COLOR GREEN +
|THEMENAME R:BASE Rocks!
CLEAR VARIABLES vPause2Message,vChkFile,vFileName,vStDate,+
vStTime,vRep,vZID
RETURN
-- End
Before copying and pasting this code, make sure to verify/update
all global variables accordingly.
Once tested and perfected, re-cycle this technique and make sure
to have fun!
Very Best R:egards,
Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================