Skip to Content
author's profile photo Former Member
Former Member

Email to users when scheduled report are finished

Hi!

We run BO 6.5 and have a lot of reports in BCA that run on both indicator and time. Sometimes the reports are delayed due to late indicator and therefore we have some users that would like to have an e-mail each time theese reports are finished. Is that possible to set up in either Desktop or BCA?

Regards, Marianne

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 07:54 AM

    Marianne,

    That is possible. In our situation we send e-mails to users (and even a number of our customers) when a report has been refreshed by the BCA.

    What we have done is added a piece of VBA code to each of the documents which need to send an e-mail after refresh. In our situation the VBA saves the report as a pdf or excel file and sends that as an attachment to the recipient. But you could also just send a standard message to the users.

    In our situation the VBA (very simplified) looks as follows:

    Private Sub Document_AfterRefresh()
        Dim FileN As String
            
        FileN = "Path and Filename of document.rep/pdf"
        
        On Error Resume Next
        doc.SaveAs (FileN)
                      
        'Mail the report to the user(s)
        On Error Resume Next
        Shell "cscript.exe pathname+filename.vbs", vbHide
                
    End Sub
    

    After the refresh the document is saved as a pdf or xls file and a cscript is executed which actually performs the sending of the e-mail.

    Below an example of one of our cscript files (adjusted)

    'Sending SMTP mail via port 25 using CDOSYS
    'This ASP page uses CDOSYS to send SMTP mail using port 25 of the SMTP server that is set.  
    'The e-mail delivery is handled by the SMTP server that is set in the configuration object.
    'send by connecting to port 25 of the SMTP server
    
    Dim iMsg
    Dim iConf
    Dim Flds
    Dim strHTML
    Dim strSmartHost
    Dim SendList
    
    Const cdoSendUsingPort = 2
    StrSmartHost = "NAME OF HOST"
    
    set iMsg = CreateObject("CDO.Message")
    set iConf = CreateObject("CDO.Configuration")
    
    Set Flds = iConf.Fields
    
    ' set the CDOSYS configuration fields to use port 25 on the SMTP server
    
    With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
    .Update
    End With
    
    ' build HTML for message body
    strHTML = "<HTML>"
    strHTML = strHTML & "<HEAD>"
    strHTML = strHTML & "<BODY>"
    strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
    strHTML = strHTML & "</BODY>"
    strHTML = strHTML & "</HTML>"
    
    SendList = "e-mail addresses seperated by ;"
    
    ' apply the settings to the message
    With iMsg
    Set .Configuration = iConf
    .To = SendList
    .From = "anything"
    .Subject = "Your subject description"
    .HTMLBody = strHTML
    .AddAttachment "Any attachments"
    .Send
    End With
    
    ' cleanup of variables
    Set iMsg = Nothing
    Set iConf = Nothing
    Set Flds = Nothing
    
    

    Hope this will get you started.

    Regards,

    Harry

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.