Focal Point
Can I email Non Scheduled Report?

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

March 11, 2008, 06:16 PM
slfmr
Can I email Non Scheduled Report?
I have a process that is calling a fex via a url. The report (fex) is analyzing data and based on that data needs to get emailed. BUT is it possible to email a report that is not technically scheduled through report caster? I don't want to schedule it as it runs only when it is called from the previous process.

Any thoughts would be appreciative.


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
March 11, 2008, 06:46 PM
Darin Lee
If you use the "Find" Facility to search the forum for topics with "email" in the subject, you will find many threads asking the same or similar questions - as recently as last week. Good luck.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 12, 2008, 08:15 AM
PBrightwell
If you are running on UNIX you can embed UNIX code into your program and use the UNIX email. Check with your systems admin.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 12, 2008, 11:31 AM
slfmr
Thanks Darin Lee! I did do a find on email and got a bunch of posts regarding Report Caster. The problem with that is that one of the reports will not be scheduled. It will be triggered by a process. So I was trying to see if specifically we can email a report without it.

PBrightwell, I did think about the Unix thing and I think that is going to be the solution to the problem. Thanks so much for your input, we can embed unix code and most likely will be the way to go!

Thanks so much,
Stacy


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
March 12, 2008, 11:59 AM
jgelona
If you have report caster do the following:



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 12, 2008, 12:18 PM
Darin Lee
There were also several posts regarding emailing without using ReportCaster. I think Pat also responded with the same info given on this thread. Also insteaad of us having to guess which platform you use, it would be helpful if you could update your profile listing not only the WF versions used, but the platform. You may get a more exact and useful response in the future.

Good luck on this task. My favorite thing to do with WF is to make it do things that it was not intended to do. Your task falls on that list (at elast without ReportCaster)

jgelona - i have another post regarding this question, but have you succesfully been able to use DSTRUN to submit an MRE report? Docs say it only works for server procedures and that is what I have found as well, but need it to work with MRE as well.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 13, 2008, 09:37 AM
PBrightwell
These are the subroutines we used for UNIX email, the UNIX code that is commented out was used to help debug. We had an imput box on the screen that we would pre-populate from the MRE user directory, but that could be overwritten so that the person running the report could email the report to someone else or to an outlook group. The mkdir will fail except for the first time. This creates a directory for the user's reports if something happens to the email. We had a UNIX sript that would delete any reports that were more than 3 days old. The rm -r will near the bottom will do the same thing.

 
-*****	EMAIL
-IF '&EMAILID.EVAL' = ' ' THEN GOTO SKIPMAIL;
-SET &&PATH= '/WEBFOCUS/temp/&MRUSER.EVAL';
-SET &EXTNT = EDIT('&GRSID.EVAL','$$$$$$$$$$$$$9999$$$');
-UNIX cd /WEBFOCUS/temp/
-SET &&FLE='&FLENAME.EVAL'|'_'|| &EXTNT.EVAL |'.XLS';
-UNIX pwd
-UNIX mkdir &MRUSER
-UNIX cd &MRUSER
-UNIX pwd
FILEDEF &FLENAME DISK &&PATH.EVAL/&&FLE.EVAL
-SKIPMAIL

-***** EMAIL MESSAGE
-HTMLFORM BEGIN
<html>
<head><title>no data found page </title></head>
<body bgcolor="#9999ff">
<hr>
<center>
<font face="Trebuchet MS" size="4" color="#000033">
<b>Your report has been emailed to you </b>
</font>
</center>
<hr>
</body>
</html>
-HTMLFORM END
 
!!!!!!!!!!!!!!!!!!!!!!!!!

REPORT GOES HERE
!!!!!!!!!!!!!!!!!!!!!!!!!

-*****	EMAIL WITH ZIP
-IF '&EMAILID.EVAL' = ' ' THEN GOTO ENDMAIL;
-UNIX cd &&PATH.EVAL
-* -UNIX ls -l
-SET &FLENAME1 = '&&FLE.EVAL';
-SET &FLN='&FLENAME.EVAL'|'_'|| &EXTNT.EVAL |'.ZIP';
-* -UNIX -rm -f &FLN
-UNIX   /usr/bin/zip &FLN.EVAL   &&FLE.EVAL
-SET &SUBJ='&FLENAME.EVAL';
-SET &STRNG = '/usr/bin/uuencode &FLN.EVAL &FLN.EVAL';
-SET &ML='mailx -s &SUBJ &EMAILID';
-UNIX  &STRNG.EVAL | &ML.EVAL
-INCLUDE emailmsg
-RUN
-* -UNIX cd /WEBFOCUS/temp
-* -UNIX rm -r &FLENAME1.EVAL
-ENDMAIL
-******

 



Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 14, 2008, 08:57 AM
jgelona
Darin,

I saw that thread about DSTRUN and MRE. I have not tried to use DSTRUN to submit an MRE Report.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 14, 2008, 11:18 AM
slfmr
Thank you all for your posts, these options are being considered for our project.

I truly appreciate all of the help.

S


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
March 24, 2008, 05:05 PM
Diptesh Patel
If you have some basic Java skills, you could relatively easily create a little Java program that will do the emailing for you. Then, have this Java program run in the fex that creates the report, after the report has been saved.


Diptesh
WF 7.1.7 - AIX, MVS
March 25, 2008, 09:18 AM
jgelona
I have come across another problem and have opened up a report with IBI. Apparently, DSTRUN cannot be used with a job that does Dynamic Distribution. I don't know why but the DSTRUN documentation specifically states that, for the job being submitted, the Distribution List must already exist, which it does not for Dynamic Distribution. I am waiting on confirmation from IBI on this and will be requesting a NFR.

I don't see the connection between requiring a distribution list and telling RC to run a job now.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 25, 2008, 01:41 PM
ira
JGELONA, I currently have a case opened with IBI on a similar issue you mentioned. In my case I have a second schedule that is kicked off from a postprocess in a first schedule. Distribution type is dynamic list. They are researching it now. I have proven to them that the DSTRUN works fine if dist. type is say email. Also, if the 2nd schedule is independently run (without the dstrun) - it too works fine. I await their responses.

Ira AIX 533 WF 5.3.8


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
March 26, 2008, 01:25 PM
Darin Lee
This probably belongs on its own thread, but in answer to jgelona's question - you may want to check out my presentation from last year's summit located here. I basically use a technique with DSTMEM to manipulate a pre-existing distribution list "on the fly" as opposed to using Dynamic List to create a distribution list. The slight difference will become apparent by reading the article.

In response to Ira's question, my own. Is the fex in the 2nd schedule an MRE fex ar a server-based procedure. I am also having problems doing what you mention with an MRE fex, but not with a server fex.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 26, 2008, 04:45 PM
jgelona
Here's what I found out from IBI. The documentation is correct. When using DSTRUN, the distribution list must exist. I also found out that if the job has multiple tasks, only the first one will run. When I asked why, this was the reply,
quote:
As for why DSTRUN does not support dynamic distribution, it is because this is an old interface that was written before dynamic distribution existed and even before schedules could have multiple tasks. (It also does not support multiple tasks in a schedule - it will only start the first task.) It was not upgraded because we developed newer API.


Darin, I'll give DSTMEM a try.

Thanks


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
May 23, 2008, 10:37 AM
slim007
Can you tell me where I can add this code to? Do I do this in UNIX?

quote:
Originally posted by PBrightwell:
These are the subroutines we used for UNIX email, the UNIX code that is commented out was used to help debug. We had an imput box on the screen that we would pre-populate from the MRE user directory, but that could be overwritten so that the person running the report could email the report to someone else or to an outlook group. The mkdir will fail except for the first time. This creates a directory for the user's reports if something happens to the email. We had a UNIX sript that would delete any reports that were more than 3 days old. The rm -r will near the bottom will do the same thing.

 
-*****	EMAIL
-IF '&EMAILID.EVAL' = ' ' THEN GOTO SKIPMAIL;
-SET &&PATH= '/WEBFOCUS/temp/&MRUSER.EVAL';
-SET &EXTNT = EDIT('&GRSID.EVAL','$$$$$$$$$$$$$9999$$$');
-UNIX cd /WEBFOCUS/temp/
-SET &&FLE='&FLENAME.EVAL'|'_'|| &EXTNT.EVAL |'.XLS';
-UNIX pwd
-UNIX mkdir &MRUSER
-UNIX cd &MRUSER
-UNIX pwd
FILEDEF &FLENAME DISK &&PATH.EVAL/&&FLE.EVAL
-SKIPMAIL

-***** EMAIL MESSAGE
-HTMLFORM BEGIN
<html>
<head><title>no data found page </title></head>
<body bgcolor="#9999ff">
<hr>
<center>
<font face="Trebuchet MS" size="4" color="#000033">
[b]Your report has been emailed to you [/b]
</font>
</center>
<hr>
</body>
</html>
-HTMLFORM END
 
!!!!!!!!!!!!!!!!!!!!!!!!!

REPORT GOES HERE
!!!!!!!!!!!!!!!!!!!!!!!!!

-*****	EMAIL WITH ZIP
-IF '&EMAILID.EVAL' = ' ' THEN GOTO ENDMAIL;
-UNIX cd &&PATH.EVAL
-* -UNIX ls -l
-SET &FLENAME1 = '&&FLE.EVAL';
-SET &FLN='&FLENAME.EVAL'|'_'|| &EXTNT.EVAL |'.ZIP';
-* -UNIX -rm -f &FLN
-UNIX   /usr/bin/zip &FLN.EVAL   &&FLE.EVAL
-SET &SUBJ='&FLENAME.EVAL';
-SET &STRNG = '/usr/bin/uuencode &FLN.EVAL &FLN.EVAL';
-SET &ML='mailx -s &SUBJ &EMAILID';
-UNIX  &STRNG.EVAL | &ML.EVAL
-INCLUDE emailmsg
-RUN
-* -UNIX cd /WEBFOCUS/temp
-* -UNIX rm -r &FLENAME1.EVAL
-ENDMAIL
-******

 



7.1.4
UNIX
Excel, PDF, HTML
May 27, 2008, 11:11 AM
PBrightwell
These were 3 different include modules that are included in the fex. There was actually a fourth one that created the message line for the email. The first one extracts the email address from a parameter page and sets the path and the filename. We actually created a directory for each user
-UNIX mkdir &MRUSER
-UNIX cd &MRUSER

you will get an error message on this if it exists, ignore it. &GRSID is a variable created in an Oracle database for identifying a specific run. It was specific to the organization, concatenate date and time together to accomplish this. The portion labeled EMAIL must go before your fex, as it creates a FILEDEF for the output. The EMAIL MESSAGE is an HTML page that will flash on the screen. I would recommend putting that before the fex as well, the program will continue to run and will send the output by email even if the user closes the window. The last portion EMAIL WITH ZIP must go after the fex. It picks up the output zips it and mails it. If you want to remove the file uncomment the LINE
-UNIX rm -r &FLENAME1.EVAL

Keep in mind UNIX is case sensitive.

I do not have a copy of the Include for emailmsg. Talk to your UNIX admin about the code needed for that or eliminate it.


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