Alpha has a really neat built in utility for emailing a report. When viewing a report, there is a toolbar option: Send report via e-mail as an Acrobat.PDF Attachment. This is a nice one step, quick way to email a report.
As neat as this feature is, I don't have very much control. I would like to be able to rename the PDF file. Alpha just takes the name of the report that is being viewed. Sometimes, the report name is not that appropriate. Also, where does Alpha store the PDF that is created?
I would like a simple xDialog that would allow me to:
1. input the PDF name
2. store the PDF on the Desktop
3. open my email with the attachment.
I have done this.
What I can't figure out is how do I capture the currently viewed report and make it into a PDF.
From what I could find, I have been using the function report.saveas() to generate the PDF. Going this route, it looks like I would have to re-run the report using the current report name, filter and order.
This could be done using global variables I guess. Just wondering if someone may have an easier way.
Thanks,
Ron
As neat as this feature is, I don't have very much control. I would like to be able to rename the PDF file. Alpha just takes the name of the report that is being viewed. Sometimes, the report name is not that appropriate. Also, where does Alpha store the PDF that is created?
I would like a simple xDialog that would allow me to:
1. input the PDF name
2. store the PDF on the Desktop
3. open my email with the attachment.
I have done this.
Code:
dim MyPDFName as C dim CurReport as C dim LoggedInUser as C = api_getusername() 'computer log in dim PDFOnDesktop as C 'enter name for new PDF file DIM SHARED vcName as C DIM XDialogStyle as P XDialogStyle.AccentColor = "Off White" XDialogStyle.Color = "Blue White" DIM SHARED varC_result as C ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("E-mail a PDF Attachment",<<%dlg% {units=F}{font=Calibri,12}{xmargin=4,4}{ysize=.3} {Windowstyle=Gradient Horizontal};; {region} Enter a Name for the PDF Attachment;; [.30MyPDFName];; {endregion}; {line=1,0};; {region} {justify=center,Center} <10,1.5=ok_button_label!OK?mypdfname<\>""> <*10,1.5=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% %code%) if varC_result <> "OK" then end end if ''windows 7 desktop PDFOnDesktop = "C:\Users\\"+loggedInUser+"\Desktop\\"+MyPDFName+".PDF" dim fn as C fn = report.saveas("_TestCust", "PDF", "", "", PDFOnDesktop) vcEmail_Addresses = "" subject_param = MyPDFName+" Report" message_param = "" Attachments = fn vcCC_Addresses = "" bcc_param = "" Email_Client_External(vcEmail_Addresses,subject_param,message_param,Attachments,vcCC_Addresses,bcc_param)
From what I could find, I have been using the function report.saveas() to generate the PDF. Going this route, it looks like I would have to re-run the report using the current report name, filter and order.
This could be done using global variables I guess. Just wondering if someone may have an easier way.
Thanks,
Ron
Comment