Is it possible to schedule a report to run AND have it export it as well?

I’m needing to schedule a canned Epicor report to run nightly but I ALSO need to automatically export it to Excel as a specific file name so I can use the data in another report. Is it possible to do this from within Epicor9??

Not without writing custom code.

If you can get the same information from the canned Epicor report in a BAQ, you can try using the Business Activity Query Export Process to schedule to be exported.

1 Like

Mike, if you can create a Query using the same tables as the report you can use the BAQ Export process to run this on a schedule and automatically output the file as xls or as an xml

Thanks everyone, I’m gonna try that!

I’m on E10 - so the following may not apply…

A “hack” would be to schedule the print job twice. Once to make it print, and the second with Export as Excel, and have it emailed to yourself.

It won’t create a unique filename for the attachment, but you could just go into your Mail client and “Save As …” the attachment, manually giving it a unique filename. I have a couple reports that run at 12:01 AM every night that go directly to my inbox (outlook uses a rule to file them in a specific folder). I only save the attachments to the server when someone needs that info.

I’ve not tried it, but it might be possible to automate the mail client (Outlook) to extract the attachment and save it with a dynamic name.

1 Like

Here’s a VBA script that will save all attachments to a unique name.

Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
Dim fName As String
Dim attachCount As Integer
attachCount = 1


sSaveFolder = "C:\Users\ckrusen\Documents\Shipping Notice\"
For Each oAttachment In MItem.Attachments
    fName = "Ship Notice " & Format(MItem.SentOn, "yyyy-mm-dd") & "_" & Format(attachCount, "000") & ".pdf"
    'oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
    oAttachment.SaveAsFile sSaveFolder & fName
    attachCount = attachCount + 1
Next
End Sub

Note that it’s only good for 999 attachments (1000 if you change it to start at 0)

The script should be called as a “run script” action in an Email rule that detects the appropriate email message.

Here is a screen shot of the rule (it’s Outlook 2007 - Please don’t judge :wink: )

And credit to How to automatically download/save attachments from Outlook to a certain folder? where I found the VBA code (I added the sequential numbering though) How to create the VBA module is in that link.

Calvin, this is awesome, thanks so much!

Best regards

Mike Abell

IT Manager

Flexial Corporation

a company of BOA Group

1483 Gould Drive, Cookeville, TN 38506, USA

Phone: +1 931 432 8408

Fax: +1 931 432 1889

Mail: mabell@flexial.com

Website: http://www.flexial.com

           http://[www.boagroup.com](http://www.boagroup.com/)