Focal Point
[SOLVED] Email and save reports in ReportCaster

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

May 07, 2010, 11:27 AM
JJ
[SOLVED] Email and save reports in ReportCaster
We have few long running reports that emailed out Excel files to users. We want to save the outputs on the server(not in Reports Library) while emailing out to users. Is there a way to do this without running reports twice?

Thanks,

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


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
May 07, 2010, 12:02 PM
Jinx
Hi,

Maybe try something like this:

  
FILEDEF FILE DISK \\FILELOCATION\FILE.XLS

-*this part will output to the file
TABLE FILE MYTABLE
PRINT
STUFF
ON TABLE HOLD AS FILE FORMAT EXL2K
END

-*this part will send in the email
TABLE FILE MYTABLE
PRINT
STUFF
ON TABLE PCHOLD FORMAT EXL2K
END



Jinx.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
May 07, 2010, 12:36 PM
Darin Lee
Actually, you don't need to do another table file. The file still exists in memory so yo can output it a second time without a new request against the data.
FILEDEF FILE DISK \\FILELOCATION\FILE.XLS

-*this part will output to the file
TABLE FILE MYTABLE
PRINT
STUFF
ON TABLE HOLD AS FILE FORMAT EXL2K
END

PCHOLD FORMAT EXL2K
END


This works fine in WF. Haven't actually tried that in RC, so I don't know what the behavior there would be (since RC seems to have its own set of rules sometimes.)


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
May 07, 2010, 04:29 PM
JJ
Thanks to both of you for your quick replies. I can't do another table file request as they are compound reports with two to three tabs(reports) in Excel. I've tried Darin's method but it gives me an error. Currently, we have same report running twice in ReportCaster for emailing and saving.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
May 10, 2010, 03:18 AM
Tony A
JJ,

We had a similar situation with compound Excel reports built using templates but our users requirement was that they would need to decide which ones were emailed or not. My solution was to write the files to the network drive and, as each one was created, write a VB Script file that would open each one in Excel (requires Excel on the server). This ran the WorkBook_Open macro which reformated each worksheet as necessary and then save the workbook as "normal" Excel - reduces the size by around 66%. The final action deletes all the macros within the workbook. Another Web Page interface allowed the end users to choose which ones were to be emailed and the submission of that form ran another .fex which created a batch file (again VB Script) that created a CDONTS object with the required file as an attachment.

You could easily combine this approach so that the CDONTS process was created at report creation and then executed at the end of the batch process so that your files were emailed to respective recipients - basically doing what RC does internally but controlling it yourself.

I have previously given example VB Script CDONTS code to send files as attachments here, combining it with your WebFOCUS code should be quite straight forward.

T

This message has been edited. Last edited by: Tony A,



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 
May 10, 2010, 09:19 AM
jgelona
I had a similar request and what I did was copy/ftp the HOLD FORMAT EXCEL output to a network drive and send the users an email with a file link to the file.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
May 10, 2010, 05:40 PM
JJ
Thank you to both of you for your suggestions.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF