Emailing Reports from APS
Emailing Reports from APS
(OP)
Does anyone have a solution for emailing in the body of an email reports that are output from an APS? I have a director who wants to see a report on his Blackberry at scheduled intervals.
I had considered creating a JAVA or VB app that looks for a .txt output from the APS and, when found, parses it into SMTP. That just seems like such a radical solution for what someone else may have already encountered and solved.
Any suggestions?
I had considered creating a JAVA or VB app that looks for a .txt output from the APS and, when found, parses it into SMTP. That just seems like such a radical solution for what someone else may have already encountered and solved.
Any suggestions?
RE: Emailing Reports from APS
I guess emailing in the body of a report means that you want to be able to email to different people based on some field in some section of the report, perhaps based on a condition?
Try using technical terms to describe the intent.
There is a 3rd party report viewer with email "bursting":
http://www.milletsoftware.com/Visual_CUT.htm
-k
RE: Emailing Reports from APS
I am scheduling a report to run on an APS server for output at several times per day. My director is frequently off-site, so I need to send reports to him on his blackberry (a wireless palm-top). The blackberry cannot handle attachments, so I need to send the contents of the report via the body of an email to him. The address will remain static, but the contents of the report, obviously, will not.
RE: Emailing Reports from APS
You we need to create an UFL or buy one. I testing this using the below code and it worked. The UFL will need to be registered on the server as well as an Development PC you use.
Mark
Public Function SendMailOutlook(sTo As String, sSubject As String, _
sTextBody As String, sFrom As String) As String
'Create an Outlook object
Dim Outlook As New Outlook.Application
Set Outlook = CreateObject("Outlook.Application")
'Create e new message
Dim Message As Outlook.MailItem
Set Message = Outlook.CreateItem(olMailItem)
'You can display the message To debug And see state
'.Display
Message.Subject = sSubject
'Message.Body = sTextBody
Message.HTMLBody = sTextBody
'Set destination email address
Message.Recipients.Add (sTo)
'Set sender address If specified.
Const olOriginator = 0
If Len(sFrom) > 0 Then
Message.Recipients.Add(sFrom).Type = olOriginator
'Send the message
Message.Send
End If
Set Outlook = Nothing
End Function
RE: Emailing Reports from APS
Neither Info nor CE allows you to insert the report within the body of the email, you have to send it as an attachment.
Mark's solution looks intriguing, though there's a good deal left to do there.
-k
RE: Emailing Reports from APS
I create a formula that is at the end or report footer of a report. In the formula I setup my UFL with the information that has been gathered as the report is processing. Than when the report is processing the footer my UFL runs, sending me totals that the report compiled.
It does not send me the whole report, just a few totals that I want daily in my Inbox/email.
I could have the report sent to me, but all I want is the totals.
This saves me opening e-mail attachements.
Mark
RE: Emailing Reports from APS
Such as exporting the report to a file, and reading the file in as text and inserting that.
Hence the database solution is much cleaner for me, if that is an option.
-k
RE: Emailing Reports from APS
This is the code I use in my formula. As I said I put this formula at the ReportFooter.
Have not tested to see if there is a limit to the sTextBody string, my guess would be yes.
Mark
// start of code
WhilePrintingRecords;
stringVar sTo :="nospam@nospam.com";
stringVar sSubject := "Reconcile for 2003" ;
stringVar sFrom := "kmsalt@nospam.com";
stringVar sTextBody := "";
sTextBody := "The reconciliation report for " + "<B>"+ {?CalendarYear} + "</B>";
sTextBody := sTextBody + "<BR>" + " The Total Pay Amount is " + totext(Sum ({mpdt.contract_pay_amt}));
sTextBody := sTextBody + "<BR>" + " For the Agency = " + "<I>" + {?Agency} + "</I>";
sTextBody := sTextBody + "<BR>" + " Isn't this a cool way to get your data?";
OutlookFDMFunctions (sTo,sSubject ,sTextBody ,sFrom )
//end of code
RE: Emailing Reports from APS
Thanks for all the suggestions. If anyone needs code for the vb app, I'd be happy to help.