7 Replies Latest reply on Jun 12, 2012 2:24 PM by macyankee86

    FDM Send Email with a Report attachment

    Pippy G
      Hi All,

      I'm currently trying to roll out a form of "Lights - Off " automation in for HFM version 9.3.3 , by using the FDM Task Manager to schedule loading information from my organisation's source system JDE.

      The final element of that automation from our perspective is to have an alert email from FDM to certain users once the 4 - Fish process is complete.

      This has worked successfully using 'Send Mail' from Accelerators, however what would be even more useful is to be able to either attach Process/Check Reports.

      I am only a beginner in VB but am willing to take steps if someone can point me in the right direction of either adding the report in the body of the email or as an attachment. I saw a great example of an email alert from Tony Scalese on the attached link

      http://www.fdmguru.com/enabling-lights-out-automation/

      Any help would be much appreciated.

      Cheers

      Pip
        • 1. Re: FDM Send Email with a Report attachment
          Pippy G
          FYI,

          Although I did not recieve any responses I have since managed to get attach items to my email alert.
          • 2. Re: FDM Send Email with a Report attachment
            A4Adroit
            Hi,

            Could you also please let me know how you achieved this.

            Regards,
            Vyas
            • 3. Re: FDM Send Email with a Report attachment
              macyankee86
              PippyG-

              I also would be interested to hear how you managed to accomplish this item.

              Any feedback you could provide would be very helpful!

              Thanks!

              Gordon
              • 4. Re: FDM Send Email with a Report attachment
                Pippy G
                Hi,

                Can you let me know what you're trying to attach. For example are you trying to attach a FDM report or a source file, the script varies dependent upon which is your requirement. Please note with email alerts the attachments can get very large in size and could clog up your email. I opted to have my script to publish reports and save on a network drive automatically upon each batch load.

                Please let me know so i can try and help.

                Cheers
                • 5. Re: FDM Send Email with a Report attachment
                  A4Adroit
                  Hi,

                  I want to attach FDM reports to the mail attachment as alerts.
                  Any help in this regards is really appreciated.

                  Thanks In Advance
                  • 6. Re: FDM Send Email with a Report attachment
                    Pippy G
                    I assume your familiar with the 'Send Mail' Accelerator script so i won't go into that part of it.

                    As mentioned previously I opted to attach the source file and save reports on a shared drive. Therefore from the selected script below you can modify to your needs.

                    Firstly I published a report (using the Report Publishing accelerator) to a specific location with a variable name (as shown in my example below) or you can give it a specific name so each time it's run it will overwrite the previously run report.

                    Publish Report*

                    Dim objReport
                    Dim lngReportID
                    Dim lngPublishType
                    Dim strPublishPath

                    'Initialize Variables
                    lngReportID = 87          'Check Report +(You need to check the report properties for this number)+
                    lngPublishType = 31          'PDF
                    strPublishPath = "C:\Temp\Validation Report_"&API.POVMgr.PPOVLocation&"_"& API.POVMgr.PPOVCategory &"_"& API.POVMgr.PPOVPeriod &"_"& FormatDateTime(Date,1)&"_"&retv&".pdf"

                    'Create the Report object
                    Set objReport = CreateObject("upsWReportingDM.clsReportPublisher")
                    objReport.mInitialize API


                    'Publish the Report
                    objReport.mReportPublishToFile CLng(lngReportID), CStr(strPublishPath), CLng(lngPublishType)

                    'Destroy the objects
                    Set objReport = Nothing


                    To attach this to your email :

                    .AddAttachment strPublishPath


                    This should get you on your way, let me know if you encounter any issues. Also as a newbie I'd appreciate it if you can tag if this message was correct or helpful.

                    Cheers

                    Pips
                    • 7. Re: FDM Send Email with a Report attachment
                      macyankee86
                      Pip-

                      Sorry it took me so long to respond, but this is extremely helpful! Thank you very much for posting some of this code!

                      Cheers!

                      Gordon