views:

226

answers:

1

Hello,

I am developing an ASP.NET MVC website. The reporting is done by SQL Server Reporting Services. I know how I can make a PDF file out of a report without showing it, yet I'm not sure what's the easiest/best way to store this file an make it available for download in MVC or send it via email (out of MVC).

Any help or direction would be greatly appreciated!

Simon

+1  A: 

We don't use SSRS specifically, but we do have a report generating service.

Emailing it out would be the easiest thing to do. Other than than, you could put it on a file share that is accessible to both ASP.NET MVC and the SSRS.

What we do is:

  1. User click's on print report button in browser, the browser posts the message to ASP.NET MVC site
  2. ASP.NET MVC site creates a GUID, loads that GUID into a message with everything else that is needed to generate the report, posts that message to a message queue, and returns the GUID to the browser
  3. The report service polls the message queue, gets the message, processes it and generates a report to a file share \reportserver\reports\GUID.pdf. When done, it writes a \reportserver\reports\GUID.done file.
  4. JS in the browser periodically pings back to the ASP.NET MVC site which, in turn, looks to see if the .done file is there. Once done, it redirects to the an action that returns the PDF.
consultutah
Thanks a lot!Would it make sense to make the complete step from klicking "Generate Report" to "Send Email" in one postback? I don't think I need the extra-service that generates the PDFs as I can do this in code.
Simon Trockel
If the load is small enough, doing it all in one postback is definitely the easiest. We have to handle a lot of load, so our architecture allows us to scale out easily.
consultutah