Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     change file extension of PCHOLD file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
change file extension of PCHOLD file
 Login/Join
 
Silver Member
posted
Hi again,

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,


---------------------
WebFOCUS 7.6
 
Posts: 41 | Registered: August 05, 2005Report This Post
Virtuoso
posted Hide Post
This a way I was told to save a file with a different extention...and it worked

First Filedef the output.
FILEDEF YODOC DISK \\webfsahq01\d$\ibi\apps\whatever\yodoc.doc

Then hold the file like this...
ON TABLE HOLD AS YODOC FORMAT HTMTABLE


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Silver Member
posted Hide Post
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.


---------------------
WebFOCUS 7.6
 
Posts: 41 | Registered: August 05, 2005Report This Post
Virtuoso
posted Hide Post
GreenspanDan,

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, 2003Report This Post
Guru
posted Hide Post
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, 2007Report This Post
Expert
posted Hide Post
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

..you might do this
-SET &MYOUT2 = 'location.href=''' | &MYOUT | ''';'; 

then in Alan's code..
<script>
&MYOUT2.EVAL
</SCRIPT>



Alan, i can't get your script codelet to display the .txt... what part am i missing?

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     change file extension of PCHOLD file

Copyright © 1996-2020 Information Builders