#1 2015-02-02 03:46:19

msmith
Member
From: Canada
Registered: 2015-01-25

Best way to export report to file on server filesystem

Hi,

I'd like to generate a report on a schedule and upload it to an SFTP server. The upload to SFTP doesn't necessarily have to happen inside ReportServer; if the output is written to the server filesystem I can have a script send it to SFTP.

Just looking for a pointer to the most sensible way to do this. Maybe there's a way to hook into the existing scheduled report functionality to either export a file to t he filesystem or do the whole SFTP exchange.

Thanks,
Mike

Offline

#2 2015-02-02 07:35:03

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Best way to export report to file on server filesystem

Hi Mike,

out of the top of my head I can think of three ways to do this:

1) Schedule a script or script report that executes the actual report and uploads the result to the SFTP server.
2) You can hook into the actual scheduler run via the net.datenwerke.scheduler.service.scheduler.hooks.SchedulerExecutionHook. Look for method

executionEndedSuccessfully(AbstractJob job, ExecutionLogEntry logEntry) 

which provides access to the executed report. The job object will be of type net.datenwerke.rs.scheduler.service.scheduler.jobs.report.ReportExecuteJob which has the method getExecutedReport.

3) You could configure the schedule operation such that the result is uploaded to the TeamSpace (maybe to a special folder SFTP). Then have a script that regularly checks this folder and if it finds anything uploads it to the SFTP server and removes it from the TeamSpace.

I hope this gives you some first pointers.

Cheers
Arno

Offline

#3 2015-02-02 16:18:38

msmith
Member
From: Canada
Registered: 2015-01-25

Re: Best way to export report to file on server filesystem

Thanks - this is great. I forgot about the embedded SFTP server.

Offline

#4 2015-02-02 18:42:17

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Best way to export report to file on server filesystem

That is a very nice idea to use the embedded SFTP server. I was actually thinking of still running a script within ReportServer and push the reports from within the TeamSpace to some external SFTP Server.

Regrettably, in the current version the embedded SFTP server does not allow to properly access the TeamSpace, so using it currently won't work. I did, however, create a feature request ticket as this should be an easy and very nice addition.

Arno

Offline

Board footer

Powered by FluxBB