Focal Point
[SOLVED] Two output distributions

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4691025312

February 16, 2007, 11:09 AM
Mark1
[SOLVED] Two output distributions
I've got a fex that somebody else wrote and the output gets filedeffed to a shared folder. But, I also need to FTP the output from ReportCaster. So, I kind of need a way for the same fex to both output to a folder and SET ONLINE-FMT TXT, so that I can FTP it. I know there are probably several ways to do this, and I could do it myself, but probably not as efficiently and easily as somebody on this board. Thanks for your help!

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


Windows version 768
February 16, 2007, 11:24 AM
susannah
Mark1,
you can have your fex post the output directly to an ftp site before it creates the emailable or postable version. You can post an htm file to an ftp site.. you can post anything you can think up to an ftp site...but i take it you want a text version, is that right?
ok
we'll do it in 3 steps
1) make the extract file
2) make a text version of the data and write your own ftp script to upload it
3) make the pretty version for parking on a shared folder.
1)
TABLE FILE CAR
PRINT SALES BY COUNTRY
ON TABLE HOLD AS MYEXTRACT
END
2)
FILEDEF FTPDATA DISK FTPDATA.TXT
TABLE FILE MYEXTRACT
PRINT * ON TABLE HOLD AS FTPDATA FORMAT ALPHA
END
-RUN
FILEDEF CHFTP DISK PUT.FTP
-RUN
-WRITE CHFTP open ftp.yourftpsite.com
-WRITE CHFTP youruserid
-WRITE CHFTP yourpassword
-WRITE CHFTP ascii
-WRITE CHFTP cd directoryname
-* you won't need to change your local directory
-* because you'll be using your agent dir
-*WRITE CHFTP lcd \
-*WRITE CHFTP lcd localdirname
-* you won't need to GET , you'll need to PUT
-*WRITE CHFTP get filename
-WRITE CHFTP put FTPDATA.TXT
-WRITE CHFTP close
-WRITE CHFTP quit
-RUN
-* now this command executes the little script you've just written
DOS ftp -i -s:PUT.FTP
-RUN
3)
-* now make your pretty report to park on your shared drive
FILEDEF MYREPORT DISK \\servername\..\MyReport.htm
TABLE FILE MYEXTRACT
PRINT *
ON TABLE HOLD AS MYREPORT
ON TABLE SET STYLE *
...
END
-* and that should do it.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 16, 2007, 12:14 PM
Tony A
Rather than have to action the second table request, you could issue the second HOLD immediately after the first table request -

TABLE FILE CAR
PRINT SALES BY COUNTRY
ON TABLE HOLD AS MYEXTRACT
END
HOLD AS FTPDATA FORMAT ALPHA
-RUN


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 16, 2007, 02:04 PM
Mark1
Thank y'all very much! Between these two, I will be able to accomplish what I need. One question, Susannah... I notice that you have merely the ftp site, name and password. However, on ReportCaster you have to fill in Server name, Directory, username and password. We are trying to FTP to another organization's server, not one of our servers.

So, what's the deal with that? Why does ReportCaster need the extra info?

We have been putting an IP address in the Server Name, but the recipient says that is not accurate because the server IP address is dynamic.


Windows version 768
February 16, 2007, 02:40 PM
susannah
I'm not using RC to contact the ftp server.
My fex will do it by writing a script.
i just need the static internet address of the outside customer's ftp server.
So ask your customer for their STATIC ftp server address.
and...further...the 'output format' in RC is completely irrelvant, as your fex is making 2 separate files and parking them as you instruct, so there is nothing to distribute.
The distribution method can also be anything you want because nothing gets distributed.
You could, of course, end your fex with some sort of status report and email it to yourself.
By handling the ftp by yourself , you're retaining full control ; you can move among directories at will, do status checks, etc, and you're not dependent on an intermediary.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 17, 2009, 01:43 PM
Duffy
Susannah, I model after your FTP commands and am having Invalid command at the point -WRITE CHFTP open ..

FILEDEF CHFTP DISK PUT.FTP
-RUN
-WRITE CHFTP open 155.17.111.9
-WRITE CHFTP pid.File
-WRITE ...
-WRITE ....

ftp> ftp> open 155.17.111.9
Invalid command.
ftp> pid.File
Invalid command.
....
....
What am I missing? I run this within MRE. Have to do with firewall? Or some other security issue? Let me know if anyone having the same issue. Thank you.


WF 7.6X
WinXP
MS SQL Server 2000
Excel, PDF, HTML, AHTML
September 21, 2009, 09:52 AM
FortuneCookie
The request worked for me (Great technique by the way Susannah).

Highly recommend that you view the contents of PUT.FTP and actually try running it via a command console to help figure out what's wrong.

based upon your error: ftp> ftp> open 155.17.111.9

it looks like you're actually invoking another FTP command within, so the session was never established.
September 22, 2009, 09:39 AM
Duffy
I figured out that the port was blocked. Thank you for your reply.


WF 7.6X
WinXP
MS SQL Server 2000
Excel, PDF, HTML, AHTML