Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Generate email for a condition
Go
New
Search
Notify
Tools
Reply
  
[CLOSED]Generate email for a condition
 Login/Join
 
Member
posted
How to generate emails in a Report for any conditions like
eg: State EQ 'A'

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.1.05
Windows 10
 
Posts: 3 | Registered: November 09, 2015Reply With QuoteReport This Post
Guru
posted Hide Post
EDAMAIL


Excecute the EDAMAIL command inside -IF THEN ELSE conditions... May be based on &LINES.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
Member
posted Hide Post
Hi thanks for the Reply,
It works if not inside a IF condition after
END

But it is showing syntax error in

IF (COND01) NE C THEN

EX EDAMAIL PERSON@domain.com;,,EDAMAILTEST,A,PDF,MAIL_FILE
Is there any way to show the PCHOLD Format HTML in Else condition?

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


WebFOCUS 8.1.05
Windows 10
 
Posts: 3 | Registered: November 09, 2015Reply With QuoteReport This Post
Master
posted Hide Post
You aren't at all clear about what you are trying to do, but Ramkumar is on the right track.

How about this:

a) Explain in general terms what you are trying to accomplish
b) Post the code that you have so far, so we can see what you are doing
c) When you do post the code, strip out the FILENAM.SEGNAME. part of your data fields so they don't clutter up the screen

If for example, you have a parameter, such as &PERSON, that you are using to generate your report, you would:

-SET &PERSONMAIL='&PERSON' || '@domain.com';

and use &PERSONMAIL in the EDAMAIL command.

You also aren't going to use PCHOLD, just HOLD for your HTML report

Here's some code of mine. I first of get a list of all the sales reps. Then, for each rep I create a distribution list by adding the sales rep's e-mail to those of the admin people. Then, with a -REPEAT I run the report consecutively for each rep and use EDAMAIL to distribute it. (There are limitations in WF that won't allow me to burst XLSX using ReportCaster, but I'm still using it for the scheduling function).


TABLE FILE SALES_TARGS
SUM SALESREP
BY SALESREP NOPRINT
ON TABLE HOLD AS ALLREPS FORMAT ALPHA
END

-SET &NUMREPS=&LINES;
-SET &ADMIN_EMAILS='gp@xxxxx.net; js@yyyyyy.com; rc@yyyyyy.com;';
-SET &REPDATE=EDIT(&YYMD, '9999-99-99');

-RUN

-READFILE ALLREPS
-REPEAT ENDREPEAT &NUMREPS TIMES

-SET &SUBJECT='Targets and Sales for ' | &SALESREP | ' ' | &REPDATE;

-SET &SREP_EMAIL=LOCASE(3, &SALESREP, 'A3') || '@yyyyy.com';

-SET &ALL_EMAILS=&SREP_EMAIL || ';' | &ADMIN_EMAILS;

-* Generate the report here and:

ON TABLE HOLD AS 'Targets and Sales for &SALESREP &REPDATE' FORMAT EXL07


EX EDAMAIL &ALL_EMAILS, ReportCaster@chemo.com, &SUBJECT,a,XLSX,baseapp/Targets and Sales for &SALESREP &REPDATE
-RUN
-READFILE ALLREPS
-ENDREPEAT
-RUN


Now you may suggest that I haven't addressed your IF condition, but in a way I have. By creating a list of sale reps and running the report only if a rep is in that list, I have created a condition. My example is probably more complex than you need (my actual report is 890 lines long) and you can create a condition without the -REPEAT.

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Generate email for a condition

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.