Focal Point
EDAMAIL corrupts file / does not format report name correctly

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

January 27, 2015, 12:41 PM
George Patton
EDAMAIL corrupts file / does not format report name correctly
I have an EXL07 (XLSX) spreadsheet report that has to go to each sales rep individually. Normally I would just sort the report with SALESREP as the first BY field and send it out with ReportCaster.

However in this case I'm using BYTOC to create separate sheets for each month of the year. Month (MTH2) is the first sort field, so bursting on SALESREP is out.

So I've turned to EDAMAIL as a substitute. (I'll create a loop and run the report sequentially for each sales rep.)

APP HOLD BASEAPP
SET COMPOUND=BYTOC

TABLE FILE H001
SUM
.......

BY  H001.H001.MTH2 NOPRINT
......

ON TABLE HOLD AS MYREPORT FORMAT EXL07
......

END

EX EDAMAIL gp@casti.net, gp@chemo.com, Sales and Targets Report,a,XLSX,baseapp/MYREPORT



It does mail something, but not what I'm looking for. What I get is an attachment just called .xlsx (no prefix) that won't open even after being renamed to something like test.xlsx.

I've determined that the expected report does get saved properly in baseapp: I can copy it manually from the server to my machine and it opens as expected.

Any suggestions ?


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
January 27, 2015, 01:45 PM
susannah
when i run exactly the same thing in 7706M server, i get
(FOC1562) EDAMAIL: FILE XLSX NOT FOUND
[oh never mind... my mistake]

so maybe the edamail syntax has changed?
afaik, its undocumented.
Tony A will know how to fix...

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 27, 2015, 01:59 PM
Francis Mariani
George,

I wonder whether the file type is XLSX or EXL07. In other WF commands, the WF "file type" does not necessarily match the Windows file type. Also, I might test with a good old EXL2K file...

Meanwhile, there is this alternative:

http://forums.informationbuild...=522105374#522105374


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 27, 2015, 03:47 PM
Francis Mariani
This works for me, with and without the BASEAPP stuff:

APP HOLD BASEAPP
-RUN

TABLE FILE CAR
SUM
SALES
BY SEATS NOPRINT
BY COUNTRY

ON TABLE SET COMPOUND BYTOC
ON TABLE HOLD AS MYEXL07 FORMAT EXL07
END
-RUN

EX EDAMAIL fm@myemail.com, fm@myemail.com, My EXL07 Report, a, XLSX, BASEAPP/MYEXL07
-RUN

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 28, 2015, 04:58 AM
Tony A
Hi George,

Not sure whether the release that you state in your signature is the current one, but I would urge you to raise a case for this.

I think that 7.7.06 is the minimal release that you may need for multi-tabbed EXL07 output with EDAMAIL.

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 
January 28, 2015, 09:27 AM
George Patton
Francis,

The same thing is happening with your example. The file gets created just fine and stored in baseapp, but EDAMAIL somehow manages to mangle it - removes the prefix and sends an attachment called .xlsx that is only 5 bytes long.

But I can use pscp to copy it from our Linux server to my desktop where it opens just fine.

I should point out that I have the same issue if I make the file type HTML.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
January 28, 2015, 10:37 AM
Francis Mariani
Perhaps the problem has something to do with one of the servers being Linux?

Or not enough -RUN statements...

The following works in an all-Windows multi-tier environment - I receive four five emails (one per COUNTRY) with spreadsheets that have multiple tabs based on SEATS (I don't use APP HOLD. I have -RUN after the HOLD format EXL07 and the EX EDAMAIL.):

SET HOLDLIST=PRINTONLY
-RUN

TABLE FILE CAR
SUM
COUNTRY
BY COUNTRY NOPRINT
ON TABLE HOLD AS HCOUNTRY
END
-RUN

-SET &COUNTRY_COUNT = &LINES;

-REPEAT END_REPEAT1 &COUNTRY_COUNT TIMES

-READFILE HCOUNTRY

TABLE FILE CAR
SUM
SALES
BY SEATS NOPRINT
BY COUNTRY

WHERE COUNTRY EQ '&COUNTRY'

ON TABLE SET COMPOUND BYTOC
ON TABLE HOLD AS MYEXL07 FORMAT EXL07
END
-RUN

EX EDAMAIL fm@myemail.com, fm@myemail.com, My EXL07 Report for &COUNTRY, a, XLSX, MYEXL07
-RUN

-END_REPEAT1

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 28, 2015, 10:59 AM
George Patton
I think I'll have to open a case as per Tony's suggestion.

Francis: Your latest (appreciated !) effort still is a no-go, even with the COMPOUND BYTOC commented out.

I'm reluctant to upgrade to 7706 even if that would fix this immediate issue - we will probably take a big leap of faith to version 8 sometime in the next 6 months anyway, and two upgrades in one year is one too many - specially with all the horror stories that V8 seems to dish up ...

In addition to opening a case I think I'll investigate the OS mail commands as per Waz's suggestion on an earlier post.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP