Skip to main content

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha567,

can you elaborate a little?

What kind of report are we talking about?

One that gets generated on a host and then downloaded to the clients and subsequently attached to an email and send to someone, or the reported gets generated from screen data, saved to file and then subsequently attached to an email and sent to someone?

Can you describe the manual process for the task?

Tom

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Currently we will order some data in RUmba app with predeinfed values (date,id's ) and the ouptut of this data is hosted in shared drive and we will manually open this file and we will convert as pdf and will send to someone as an email with attachment of this data . Instead of hosting it in shared drive and doing all these manually steps , we would like to send ouput directly to someone in email with attachment .

Thanks

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Currently we will order some data in RUmba app with predeinfed values (date,id's ) and the ouptut of this data is hosted in shared drive and we will manually open this file and we will convert as pdf and will send to someone as an email with attachment of this data . Instead of hosting it in shared drive and doing all these manually steps , we would like to send ouput directly to someone in email with attachment .

Thanks

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Currently we will order some data in RUmba app with predeinfed values (date,id's ) and the ouptut of this data is hosted in shared drive and we will manually open this file and we will convert as pdf and will send to someone as an email with attachment of this data . Instead of hosting it in shared drive and doing all these manually steps , we would like to send ouput directly to someone in email with attachment .

Thanks

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha,

The following works for me from Outlook VBA: where c:\\temp\\mytextfile.txt is my report, C:\\temp\\myNewPDFfile.pdf is the pdf version generated on the fly, and FirstName.LastName@mydomain.com is the email address I wish to send the .pdf file.

Sub CreateNewWordDoc()
Dim wrdApp As Object
Dim wrdDoc As Object
Dim emailDoc As Object

Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open("c:\\temp\\mytextfile.txt", False)
wrdDoc.ExportAsFixedFormat OutputFileName:="C:\\temp\\myNewPDFfile.pdf", ExportFormat:=wdExportFormatPDF

wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing

Set emailDoc = ThisOutlookSession.CreateItem(olMailItem)
emailDoc.Attachments.Add ("C:\\temp\\myNewPDFfile.pdf")
emailDoc.Recipients.Add ("FirstName.LastName@mydomain.com")
emailDoc.Send
End Sub

Note: Running this from outside Outlook may prove to be a little problematic as the programmatic sending of emails from outside Outlook may well be blocked my Microsoft or by your Antivirus software.

Note: This macro also uses MS Word to generate the .PDF from the .txt file.

Tom

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha,

The following works for me from Outlook VBA: where c:\\temp\\mytextfile.txt is my report, C:\\temp\\myNewPDFfile.pdf is the pdf version generated on the fly, and FirstName.LastName@mydomain.com is the email address I wish to send the .pdf file.

Sub CreateNewWordDoc()
Dim wrdApp As Object
Dim wrdDoc As Object
Dim emailDoc As Object

Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open("c:\\temp\\mytextfile.txt", False)
wrdDoc.ExportAsFixedFormat OutputFileName:="C:\\temp\\myNewPDFfile.pdf", ExportFormat:=wdExportFormatPDF

wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing

Set emailDoc = ThisOutlookSession.CreateItem(olMailItem)
emailDoc.Attachments.Add ("C:\\temp\\myNewPDFfile.pdf")
emailDoc.Recipients.Add ("FirstName.LastName@mydomain.com")
emailDoc.Send
End Sub

Note: Running this from outside Outlook may prove to be a little problematic as the programmatic sending of emails from outside Outlook may well be blocked my Microsoft or by your Antivirus software.

Note: This macro also uses MS Word to generate the .PDF from the .txt file.

Tom

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Tom,

Instead of creating macro's is there a way to schedule the same at Rumba application level . I mean currently once we run the report and the output is going to shared drive and we will manually convert as pdf & send as mail . Is there a way to configure the report ouput directly as such it will go to user email box directly in Rumba platform itself .

Thanks

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha567,

I'm assuming that the "Report" is downloaded from the host (which is an iSeries/AS400) and not is created using screen scraping.

Currently out of the box the closest you can get is to schedule a 5250 Batch File Transfer to download the report and to then automatically create an email with is attached and attempt to send it (at which point Outlook will likely prompt you asking if you really want to send it). You can not do the .PDF conversion, from within Rumba.

The only way to achieve your goal is by using a macro/or script. If created a script which mimics what you need.

Here is my RUMBA script.

Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE
Const WM_CLOSE = &H10

Sub Main
Dim objShell As Object, wrdApp As Object, wrdDoc As Object, emailDoc As Object, objOutlook As Object

Const DontWaitUntilFinished = False, ShowWindow = 1, DontShowWindow = 0, WaitUntilFinished = True

Set objShell = CreateObject("WScript.Shell")
CmdLine = "cmd /c C:\\Users\\TomFi.ATTACHMATE\\Documents\\TomF_Movies_BFT.BTF"
objShell.Run CmdLine, DontShowWindow, WaitUntilFinished

Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open("c:\\temp\\TomF_Movies.txt", False)
wrdDoc.ExportAsFixedFormat "C:\\temp\\TomF_Movies.pdf", 17

wrdApp.Quit
Sleep 1000
Set wrdDoc = Nothing
Set wrdApp = Nothing

Set OutlookApp = CreateObject("Outlook.application")
Sleep 1000
Set emailDoc = OutlookApp.CreateItem(olMailItem)
emailDoc.Attachments.Add ("c:\\temp\\TomF_Movies.pdf")
emailDoc.Attachments.Add ("C:\\Users\\TomFi.ATTACHMATE\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf")
emailDoc.Recipients.Add ("Sesha567@somewhere.com")
emailDoc.Recipients.Add ("Someone.Else@somewhere.com")
emailDoc.Subject = "For Sesha567 from Tom"
emailDoc.send
End Sub

To use this approach you need to set up a file transfer (rto) and then add it to a batch file transfer (.bft). You can set the .bft to run silently, run automatically, run minimised and to automatically close when complete.

Once you have the scripts working, then you can launch it via a command line using vsp.exe,
e.g.
C:\\>"C:\\Program Files (x86)\\Micro Focus\\RUMBA\\System\\ScriptEngine\\vsp.exe" C:\\Users\\Tom\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf

So how does the work.

My file transfer config is set to download my host data and save it as a tab delimited text file.
My batch file transfer list is configured to automatically execute when it is opened, to run silently and minimised and to close automatically when complete.
When the script executes is first shell a command to open my batch file list, which then execute automatically.
Once that is complete, I open MS Word and the downloaded .txt file, and then convert it to a .pdf and exist word.
Finally I open Outlook, create an email, add the recipients, attached the .pdf file and send it.

Tom

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha567,

I'm assuming that the "Report" is downloaded from the host (which is an iSeries/AS400) and not is created using screen scraping.

Currently out of the box the closest you can get is to schedule a 5250 Batch File Transfer to download the report and to then automatically create an email with is attached and attempt to send it (at which point Outlook will likely prompt you asking if you really want to send it). You can not do the .PDF conversion, from within Rumba.

The only way to achieve your goal is by using a macro/or script. If created a script which mimics what you need.

Here is my RUMBA script.

Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE
Const WM_CLOSE = &H10

Sub Main
Dim objShell As Object, wrdApp As Object, wrdDoc As Object, emailDoc As Object, objOutlook As Object

Const DontWaitUntilFinished = False, ShowWindow = 1, DontShowWindow = 0, WaitUntilFinished = True

Set objShell = CreateObject("WScript.Shell")
CmdLine = "cmd /c C:\\Users\\TomFi.ATTACHMATE\\Documents\\TomF_Movies_BFT.BTF"
objShell.Run CmdLine, DontShowWindow, WaitUntilFinished

Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open("c:\\temp\\TomF_Movies.txt", False)
wrdDoc.ExportAsFixedFormat "C:\\temp\\TomF_Movies.pdf", 17

wrdApp.Quit
Sleep 1000
Set wrdDoc = Nothing
Set wrdApp = Nothing

Set OutlookApp = CreateObject("Outlook.application")
Sleep 1000
Set emailDoc = OutlookApp.CreateItem(olMailItem)
emailDoc.Attachments.Add ("c:\\temp\\TomF_Movies.pdf")
emailDoc.Attachments.Add ("C:\\Users\\TomFi.ATTACHMATE\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf")
emailDoc.Recipients.Add ("Sesha567@somewhere.com")
emailDoc.Recipients.Add ("Someone.Else@somewhere.com")
emailDoc.Subject = "For Sesha567 from Tom"
emailDoc.send
End Sub

To use this approach you need to set up a file transfer (rto) and then add it to a batch file transfer (.bft). You can set the .bft to run silently, run automatically, run minimised and to automatically close when complete.

Once you have the scripts working, then you can launch it via a command line using vsp.exe,
e.g.
C:\\>"C:\\Program Files (x86)\\Micro Focus\\RUMBA\\System\\ScriptEngine\\vsp.exe" C:\\Users\\Tom\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf

So how does the work.

My file transfer config is set to download my host data and save it as a tab delimited text file.
My batch file transfer list is configured to automatically execute when it is opened, to run silently and minimised and to close automatically when complete.
When the script executes is first shell a command to open my batch file list, which then execute automatically.
Once that is complete, I open MS Word and the downloaded .txt file, and then convert it to a .pdf and exist word.
Finally I open Outlook, create an email, add the recipients, attached the .pdf file and send it.

Tom

In Rumba Can we schedule report output in email with PDF format ? If possible , Please provide the steps.


#Rumba
Hi Sesha567,

I'm assuming that the "Report" is downloaded from the host (which is an iSeries/AS400) and not is created using screen scraping.

Currently out of the box the closest you can get is to schedule a 5250 Batch File Transfer to download the report and to then automatically create an email with is attached and attempt to send it (at which point Outlook will likely prompt you asking if you really want to send it). You can not do the .PDF conversion, from within Rumba.

The only way to achieve your goal is by using a macro/or script. If created a script which mimics what you need.

Here is my RUMBA script.

Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE
Const WM_CLOSE = &H10

Sub Main
Dim objShell As Object, wrdApp As Object, wrdDoc As Object, emailDoc As Object, objOutlook As Object

Const DontWaitUntilFinished = False, ShowWindow = 1, DontShowWindow = 0, WaitUntilFinished = True

Set objShell = CreateObject("WScript.Shell")
CmdLine = "cmd /c C:\\Users\\TomFi.ATTACHMATE\\Documents\\TomF_Movies_BFT.BTF"
objShell.Run CmdLine, DontShowWindow, WaitUntilFinished

Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open("c:\\temp\\TomF_Movies.txt", False)
wrdDoc.ExportAsFixedFormat "C:\\temp\\TomF_Movies.pdf", 17

wrdApp.Quit
Sleep 1000
Set wrdDoc = Nothing
Set wrdApp = Nothing

Set OutlookApp = CreateObject("Outlook.application")
Sleep 1000
Set emailDoc = OutlookApp.CreateItem(olMailItem)
emailDoc.Attachments.Add ("c:\\temp\\TomF_Movies.pdf")
emailDoc.Attachments.Add ("C:\\Users\\TomFi.ATTACHMATE\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf")
emailDoc.Recipients.Add ("Sesha567@somewhere.com")
emailDoc.Recipients.Add ("Someone.Else@somewhere.com")
emailDoc.Subject = "For Sesha567 from Tom"
emailDoc.send
End Sub

To use this approach you need to set up a file transfer (rto) and then add it to a batch file transfer (.bft). You can set the .bft to run silently, run automatically, run minimised and to automatically close when complete.

Once you have the scripts working, then you can launch it via a command line using vsp.exe,
e.g.
C:\\>"C:\\Program Files (x86)\\Micro Focus\\RUMBA\\System\\ScriptEngine\\vsp.exe" C:\\Users\\Tom\\AppData\\Local\\Micro Focus\\Rumba\\Scripts\\DownloadAndEmail.csf

So how does the work.

My file transfer config is set to download my host data and save it as a tab delimited text file.
My batch file transfer list is configured to automatically execute when it is opened, to run silently and minimised and to close automatically when complete.
When the script executes is first shell a command to open my batch file list, which then execute automatically.
Once that is complete, I open MS Word and the downloaded .txt file, and then convert it to a .pdf and exist word.
Finally I open Outlook, create an email, add the recipients, attached the .pdf file and send it.

Tom