Focal Point
[CLOSED] send compound pdf via edamail

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

January 13, 2017, 04:48 AM
WFtESTER
[CLOSED] send compound pdf via edamail
hi all

I'm trying to send a generate document via edamail. it will just not attach or include the pdf file to the email. I tried with FLAG=A or without that parameter, without success.

here my test code:

 
SET HTMLARCHIVE=ON

-SET &TESTVALUE = 'This is just something to place on the pdf document';
-SET &FILENAME = 'C:\temp\&YYMD.EVAL_test.PDF';

*-HOLD_SOURCE
COMPOUND LAYOUT HOLD FORMAT PDF
UNITS=CM, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=A4, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
OBJECT=STRING, NAME='text1', TEXT='<font face="TREBUCHET MS" size=10>Text blabla<br><br>&TESTVALUE</font>', POSITION=(3.122 2.646), MARKUP=ON, WRAP=ON, DIMENSION=(13.758 3.175),  METADATA='left: 3.122cm; top: 2.646cm; width: 13.758cm; height: 3.175cm; font-family: Trebuchet MS; font-size: 10pt; position: absolute; z-index: 1;', $
COMPONENT='DfltCmpt1', POSITION=(0 0), DIMENSION=(0 0),  $
END
SET COMPONENT='DfltCmpt1'
TABLE FILE SYSCOLUM
" "
SUM TBNAME NOPRINT
IF READLIMIT EQ 1
ON TABLE SET PREVIEW ON
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS &FILENAME FORMAT PDF 
ON TABLE SET STYLE *
END
COMPOUND END

-RUN

-DEFAULT &MAILSUBJECT	= 'E-Mail Test';
-DEFAULT &MAILFROM		= 'my@ddress.tld';
-DEFAULT &MAILTO		= 'mail1@somthing.tld; mail2@something.tld;';

EX EDAMAIL to=&MAILTO.EVAL,toaddr=&MAILTO.EVAL,
from=&MAILFROM,subject='&MAILSUBJECT.EVAL', filetype=PDF,FLAG=A,
filename=&FILENAME
-RUN
 


any idea how I can attache this document?

many thanks

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


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
January 15, 2017, 04:21 PM
Waz
Hi WFtESTER,

Try just using a name in &FILENAME, instead of a filename and location.

-SET &FILENAME = '&YYMD.EVAL_test';

EX EDAMAIL to=&MAILTO.EVAL,toaddr=&MAILTO.EVAL,
from=&MAILFROM,subject='&MAILSUBJECT.EVAL', filetype=PDF,FLAG=A,
filename=&FILENAME
-RUN




Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 16, 2017, 02:24 AM
WFtESTER
Hi Waz

That's what I tried first (edatemp) but it was not working.

setting a variable even with full path and unc path, is working fine with other procedures.


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
January 16, 2017, 03:59 AM
WFtESTER
I did some more tests and get the following result:

WORKING CODE:

 TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS EMAIL_ATTACHMENT FORMAT PDF
END
-RUN
EX EDAMAIL to@ddress.com,from@ddress.com, edamail with attachement,A,PDF,EMAIL_ATTACHMENT
 



I'm still not able to save the report somewhere and than to attach it from this location. That would be nice but otherwise I'll just save the report twice, once in edatemp for the email and once on the location where it is needed.

many thanks

wftester


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
January 16, 2017, 01:04 PM
dhagen
You were using the wrong syntax for multiple lines:

EX -LINES * EDAMAIL to=&MAILTO.EVAL,toaddr=&MAILTO.EVAL,
from=&MAILFROM,subject='&MAILSUBJECT.EVAL', filetype=PDF,FLAG=A,
filename=&FILENAME
EDAMAIL*  



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
January 16, 2017, 03:38 PM
Waz
If you want the PDF to be saved elsewhere, then use FILEDEF first to point the {As Name} to another location.

Put the FILEDEF before the TABLE FILE with the HOLD AS Format

FILEDEF {As Name} DISK {physical location}


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 17, 2017, 09:34 AM
Sydney
Hello WFtESTER,

Could you try the below and see if it works for you? I have labeled everything in a way that I hope you can understand.

TABLE FILE ORIGINALFOLDERNAME/FILENAME
PRINT COLUMN_1
ON TABLE HOLD AS SAVETOFOLDERNAME/MAILFILENAME FORMAT PDF
END
-RUN

EX EDAMAIL senderemailaddress@email.com;recipient1emailaddress@email.com;recipient2emailaddress@email.com,recipient3emailaddress@email.com,subject of email,A,PDF,SAVETOFOLDERNAME/MAILFILENAME

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


WebFOCUS 8.2
Windows, All Outputs