As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I've looked through the documentation and i THINK i'm doing it right, but i can't seem to control the extension that PCHOLD files are coming to the browser with.
the user wants to export a file to .txt format, and wants that file to come back with a .txt extension. however, the following code:
ON TABLE PCHOLD AS myReport.txt FORMAT ALPHA
returns to the browser a file named "wfservlet" with no file extension. i've tried DOC and WP, but those formats try to open the file in Word or WordPerfect, which are inappropriate for a plain text document.
is there any way to control the name and extension of the file that gets returned to the user on a PCHOLD command? WebFOCUS doesn't seem to be respecting my "AS myReport.txt" on that line.This message has been edited. Last edited by: GreenspanDan,
If you want the file to come back to the user automatically, try:
FILEDEF SAVE DISK appDirName/SAVE.TXT
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
ON TABLE SAVE
END
-RUN
-HTMLFORM BEGIN
<html>
<script>
location.href='../../appDirName/save.txt';
</script>
</html>
-HTMLFORM END
The appDirName must be available to the web server as well as to WebFOCUS. The location.href can be an absolute url starting http:// da di da
I use this frequently for users to save data for whatever nefarious activities they want.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
correct me if i am mistaken, but wouldn't those methods save the hold file to the server's hard drive, before passing it to the user? how long would those saved files stay there on the server, and could they be deleted?
if so, i suppose this could work, but it sure seems like a lot of i/o and disk activity just to change a filename.
You are correct that this will hold the file on the server's hard drive. If you have all the components of WF on the same machine you can take advantage of the WF CLIENT auto clean up function. There is a setting in the WF CLIENT to clean up files from its temp dir that are older than so many minutes. I setup my WF installation to pass the temp dir of the WF CLIENT as a variable to the WF SERVER. I then put any HOLD file created by the WF SERVER into this directory. The clean up function of the WF CLIENT will then delete these files when necessary.
I added the following to the SITE.WFS file for the WF CLIENT. This can be done in the WFC Console in the Configuration/Custom Settings area.
IBITMP=&CGI_TEMP_DIR
IBITMP(pass)
Then FILEDEF your file using the &IBITMP variable so it HOLDs the file to that directory.
Please let me know if you have questions.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
I'm guessing from my own experiments and from this and similar posts that the [AS filename] portion of the PCHOLD command doesn't work. Would you concur?
With regard to the FILEDEF technique, how would you handle that if you allowed the user to select the output format?
Thanks,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
the server location could be the agent directory itself, which would vanish once the report appeared. Same as any html output or any ON TABLE PCHOLD FORMAT EXL2K or WP or whatever vanishes. grab the name of the agent directory with the TEMPPATH command -SET &MYPATH = TEMPPATH(50,'A50'); you might want to clean it up a bit, shorten it, there are a number of ways. You could glue on the output file name and SQUEEZ the blanks out, or
-SET &MYPATH = TEMPPATH(50,'A50');
-SET &AL = ARGLEN(50,&MYPATH,'I2') ;
-SET &LAL ='A'|&AL;
-SET &MYPATH = SUBSTR(50,&MYPATH,1,&AL,&AL,'&LAL');
and then glue on the output file name.
-SET &MYOUT=&MYPATH | 'SAVEIT.TXT';
FILEDEF the output file, as Alan says, but you can just FILEDEF it to the agent
FILEDEF SAVEIT DISK SAVEIT.TXT
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
ON TABLE SAVE AS SAVEIT
END
-RUN
-HTMLFORM BEGIN
<html>
<script>
-*..you may have to do somework here to get the syntax recognized...but you get the idea.
location.href='&MYOUT';
</script>
</html>
-HTMLFORM END