April 30, 2008, 05:15 PM
Tony ATrina,
When you say that it doesn't work, I guess you mean that you can't locate the file or that the file is not named correctly when you cast it to the recipient email address?
Let's take a step back and explain a few things.
When you run a report through RC and want RC to cast the output, then the file name will be what you have set in the relevant input text box via RC.
If you want to control the file name then you generally have to resort to forcing your fex to do the hard graft and use HOLD AS filename within your code. As you have discovered you will have to filedef the ddname etc. but you still have to understand how WF functions in regard to filedefs.
If you filedef the full and complete path within your filedef then the file will end up in the directory specified
relative to the reporting server. e.g FILEDEF DDNAME DISK C:\ibi\apps\ibisamp\rcoutput.xls used with ON TABLE HOLD AS DDNAME FORMAT EXL2K will place the "Excel" file on your reporting server in the folder etc.
if the folder exists (the filename is created so it obviously doesn't have to exist).
If you do not specify the full path with the filedef then the file will end up in the temprary folder for the agent number that is used to run the fex. (see other posts on getting the temp folder name). This is not normally good because the folder is emptied when the agent finishes running your report. So FILEDEF DDNAME DISK rcoutput.xls with ON TABLE HOLD AS DDNAME FORMAT EXL2K will end up somewhere like C:\ibi\webfocus76\wfs\edatemp\ts000001\rcoutput.xls - albeit very briefly before WF cleans up the folder!! You can cathc this file and copy it to a location that you wish by using a system command such as CMD COPY rcoutput.xls C:\etc. etc. etc. You could also copy it to a share on another machine via CMD COPY rcoutput.xls \\[machine name]\[share name]\etc. etc. etc.
Next you have to understand the difference between PCHOLD and HOLD. PCHOLD will return the file to the client browser when the fex is run interactively (i.e
not through RC. HOLD will place the file on the reporting server, location depandant upon whether you have used FILEDEF or not.
So using your filedef and PCHOLD, RC would have ignored the PCHOLD and placed the output into a file named as per the dialog within RC when the scheduled task was created and sent that file to the spcified recipient.
Using your filedef with HOLD would have placed the file into the edatemp folder on your reporting server mometarily before delaeting it!
However, before you get too despondant, there is a method you could use, and that would be to have a pre process to set the file name in the RC dialog - which is actually held in one of the RC tables - to something you want. Not straight forward for a beginner but it is possible.
I hope that this has explained a few things without causing more confusion
and good luck
T
April 30, 2008, 05:50 PM
PrarieWow...that was quite a mouth full...Tony..shouldn't you be sleeping?