Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding Azure reports to MVC app

I want to embed reports to a MVC application which are hosted on Azure Reporting Server.

Do any one have any idea ?

like image 337
Krrish Avatar asked Dec 03 '25 18:12

Krrish


1 Answers

You'll be aware that the regular ReportViewer is not MVC-friendly (if ever there was an understatement...)

My approach has been to use the Report Execution service (https:///reportserver/ReportExecution2005.asmx) directly.

Basic steps are:

  1. Logon to the report server with the .LogonUser method
  2. Load the report with the .LoadReport method
  3. Set the .ExecutionHeader property to a new ExecutionHeader object
  4. Build any parameters and set them using the .SetExecutionParameters method
  5. Render the report using the .Render method
  6. Get the HTML content of the report using the appropriate encoding (which you'll get from the .Render method)

I've encapsulated this lot in a controller action that returns a Content ActionResult containing the report.

You'll have to forego most of the rich interactive features, as they don't tend to play nicely (or you can put the work into sorting out why).

However, I'm now moving away from SQL Azure Reporting Services. For my application, I found it was just too slow and limited. SQL Azure will terminate a query that takes more than a minute and in my case (primarily because of the complexity of the underlying queries) many of my reports consistently time out.

Your mileage, of course, may vary.

like image 124
Steve Morgan Avatar answered Dec 06 '25 08:12

Steve Morgan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!