Create Excel file from baq result and send file via email

Hi all!

Is it possible to create an excel file from the results of a baq and then send the file via mail?
I need to send an excel every morning with the results of a baq. I already created a new system agent schedule and a BPM (data - standard - SysAgentSched) to fire up when the agent is changed.
I already know that there is a simple thing in the BPM to send the email but I don’t know how to create an excel file with the BAQ results…

Can someone help me?
Thanks!

If you create a BAQ Report that displays the information you need from the BAQ, you can schedule the report to send and it will send an email with an xlsx attachment.

Create a System Agent schedule that you want the email to go out on. Then in the report options select that schedule, set the task to Recurring, set your output format to Excel or Excel Data-Only, and use the Email Report button to set your email options. Then, the report data should send out on your schedule as an attachment to the email.

I’m sorry can you be more specific?
It’s my first time doing this…
I created my BAQ and my Agent schedule

But know I am stucked on creating the BAQ report

You can also use the BaqSvc in the API to “live link” to the data. Of course, that only works if the recipient of the report has access to Epicor.

1 Like

The Epicor Application Help and the ICE Tools User Guide have a good walk-through of the process of creating a BAQ Report. If you have access to EpicWeb, the Tools guide can be found here: Sign In

Essentially from the BAQ Report Designer, you will need to use Actions > Download SSRS Report to save the RDL file. From there, you will use SSRS Report Builder to build the layout of your report. For a report that you will export to Excel, I suggest using a Table to keep everything in a neat grid. Once you’re done building the layout, you will return to BAQ Report Designer and select Actions > Upload report. From there, you can go to Actions > Test Report Form to test-run the report.

You can put in your link in Excel OData Data Feed:

Of course, if you wanted to add extra security you could use v2 for your link.

1 Like

I’ve got to try this!!

But if you want a record of what the data was at the time the BAQ was run (like a daily “paper copy” of Stock Status), you’d need to go the BAQ Report + Email way.

I will try it. Thanks!

And then you use SSRS Breaking / routing, and use the graphical designer to create an email.

Don’t forget to mark your BAQ “Shared”

This is an example with lots of possible different emails

Here’s an example of the email template inside the breaking / routing designer. The BAQ report is automatically attached. It just comes from a table inserted in the SSRS report designer.

Select “EXCEL” on the print preview box and it should just work.

image

Hi Steve,

Is there a way to pass a parameter to the BAQ Report doing something like this? I haven’t been able to find a way, but I’d like to be able to set a sales rep parameter in the BAQ and then pass that in so I can send each sales rep a report that is specific to themselves.

I don’t know about passing a parameter (I immediately start thinking about LaunchFormOptions, QV) but sending each person a user-specific report shouldn’t be hard. In your BAQ report style breaking/routing I think you can do a fair bit with queries.

1 Like