Search code examples
model-view-controllerreporting-servicesreportrdlcrdl

What is the best way for creating reports in MVC?


I've been reading online about either using RDLC or RDL reports however, I'm not sure if this is correct/best path for creating reports.

Any other recommendations are very much appreciated it.


Solution

  • MVC is a style of web development that doesn't really have anything to do with reporting. Your options are basically (1) create "reports" as web pages that dump data to the screen, or (2) use a report engine like SSRS (which uses .rdl) or BIRT. The first option is terrible if anyone ever wants to save or print the report. It's difficult to get it to page correctly or even group and sort things they way you want. Reporting engines handle all of that for you, so it knows how much data will fit onto a page given the paper size and margins you've set, and they have built-in methods for exporting the data to PDF/Word/Excel, etc. They also make it easy to add headers, footers, page x of y, etc.

    For SSRS you'll need a SQL database with SSRS installed, and it serves reports up via its own version of IIS. This usually means that you'll need a hyperlink on your MVC app that points to the report's URL on the report server. You can either use ReportBuilder or Visual Studio with the appropriate settings (see SQL Server Data Tools). If the reports need to be served up to the public as opposed to within your company, you also need to be careful with both security settings and licensing on the SQL server.

    BIRT is the best-known open source version of a reporting engine, but I've never used it so I have to leave that up to you to research. There are probably others.