Focal Point
Create Multiple XLS files in a Directory Using WebFocus

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

May 22, 2008, 05:58 PM
slim007
Create Multiple XLS files in a Directory Using WebFocus
I want to execute a focexec file to generate an xls file for every record in a table. Then I want to send each xls file to each email address (that was in each record). My question is it possible to generate a large number of files and save the xls files in a directory using WebFocus?

Thanks.


7.1.4
UNIX
Excel, PDF, HTML
May 22, 2008, 07:42 PM
N.Selph
The best way would be to use Report Caster's bursting option with Excel, and distribute the output with a dynamic address list.
There have been several posts describing how to do the dynamic address lists.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
May 22, 2008, 07:46 PM
jnc
The e-mail part would be easy. It's exactly what ReportCaster is designed to do.

Making many separate XLS files, that is another story. Possible, but probably clumsy. Could you burst the files to ReportLibrary. That would be handy. Except it still would take two RC jobs.
One for the mail list, the other for the Library Job.


WebFocus 7x, 8x, Win / Linux, any output format
May 23, 2008, 08:26 AM
PBrightwell
Why not use dialog manager and UNIX email? Before you attempt this make sure your UNIX email server is running, some companies turn off that option because it can use a lot of resources.

-STRTHERE
-* &&PATH is the path on your UNIX server where you will store the output
FILEDEF EMAILTXT DISK &&PATH.EVAL/emailtxt.xls
-RUN
-* FILEA is your input file the field sizes should be what and where they are in the record
-*
-READ FILEA NOCLOSE &EMAILID.A30 &REST.A80
-IF &RETCODE NE 0 GOTO ENDPGM;
TABLE FILE FILEA
PRINT *
WHERE EMAILID EQ &EMAILID
ON TABLE HOLD AS EMAILTXT FORMAT EXL2K
END
-RUN
-UNIX cd &&PATH.EVAL
-SET &SUBJ='Here is your report';
-SET &STRNG = '/usr/bin/uuencode emailtxt.xls emailtxt.xls';
-SET &ML='mailx -s &SUBJ &EMAILID';
-UNIX &STRNG.EVAL | &ML.EVAL

-RUN
-GOTO STRTHERE;
-ENDPGM

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
May 23, 2008, 02:05 PM
slim007
PBrightwell,

I am fairly new to WebFocus. What is the dialog manager? Where would I put this code?

Thanks.


7.1.4
UNIX
Excel, PDF, HTML
May 27, 2008, 11:33 AM
PBrightwell
My previous answer would be your code. You will need to know where the email address is in the record. The remainder of the fields can be grouped together in the -READ statement. You can not do this with the drag and drop feature of Dev Studio, you will have to edit the code.
FILEA in my example is your input file that contains the email address and the record you want to email. If there is more than one record per email address you will want to modify this to handle it. Any command that starts with a - is a dialog manager command including -* and -INCLUDE.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes