Auto Generate/Save Report PDF

Looking for a way to have a report generated as a PDF and saved to a network share when a field value changes. I can see with a BPM where I could run a report when a field value changes. But can’t find a way to save the PDF to a network share or local file share. Could use the REST API if that’s a way to do it. But don’t see a way with the API to do this either.

I would need a program to take the output and convert it to a PDF and save it, correct? At least that’s what I got out of that before I posted this.

Nope. SSRS will create the PDF at the server. You just need to pull down the bytes like the System Monitor does.

1 Like

Where is the file saved to though?

The Report Database. Here’s a trace of how Epicor retrieves it.

1 Like

Chadd -

Have a look at this posting for how to have the Reporting system write out to the File System. At the moment this is limited to writing out to the EpicorData directory but you can create a Share to your defined output location from within EpicorData.

2 Likes

I’ll take a look at this. Thanks!

I’m trying to reduce the blast area of malware so I recommend against file shares at our company unless absolutely necessary. YMMV. I’m working on a PowerShell script that acts like the Report Monitor and places the document directly into SharePoint with meta data attached and optionally linking the document to multiple Epicor records. It will work on prem as well as in the cloud.

Rich - I keep getting the error ‘Unauthorized server path.’

I have tried both the local and network share path for the EpicorData directory. What should the Report Options be for this to work?

As Rich mentioned in his post, you have to give write access to the App Server user for that share.

The service account user has full access to the share.

And you’re using a fully-qualified name to the share and not a mapped drive letter?

Not the FQ name as it’s too long.

File:\\erp-apps1\EpicorData\Reports\{ReportID}.pdf

Try leaving off the

\erp-apps1\EpicorData\Reports 

and see where it lands. It is relative to the Task Agent folder. If that doesn’t work, add

Reports\

back in.

Wait, I went back to Rich’s post and he added this:

1 Like

I read that but read it as we could still write to the ERPData directory.

I think I understand why Epicor may have changed this behavior. If you’re printing sensitive data, you have to manage folder security by yourself. If they put it in the user directory then you could at least add user security to that folder to keep unauthorized users from viewing sensitive reports. I believe that by going through the business objects, report security is enforced because you have to login and own the report or be Security Manager.

So I would hazard a guess that the place the report will appear is under

reports\%username%

Your goal is to get it to a folder but picking the folder might be a stretch goal that you may not be able to reach.

I can’t get that to work either. Seems Epicor has completely removed this functionality.

What does your report style look like in the Options field? If you put File:{yourOptionValue}.{yourExtention} it should put in in the server (where the Task Agent is running, I believe).

Report Style:

Network Location of App Sever\EpicorData\Reports{UserWhoSubmittedIt}

2 Likes