Thursday, October 17, 2013

Use Cases for Reporting Services

Overview

  • Report Viewer Control
  • Reporting Services (Standalone)
  • Reporting Services (SharePoint-Integration)
  • Reporting Builder

Types of files used


.RDLC

  • No Reporting Services installation required
  • Takes .NET DataSet (object in code) as a data source / dataset.
  • Code change required to update DataSet.
  • Report is generated by the hosted application
  • Can be referenced by Report Viewer Control
  • Requires .NET application
  • Use newest version of Visual Studio to create report
  • User Parameter GUI is manually created by developer on page.


.RDL

  • Requires Reporting Services installation
  • DataSet is defined using GUI, not code
  • No code changes required to update DataSet.
  • Report is generated by Reporting Services
  • Can be referenced by Report Viewer Control
  • .NET application is optional
  • Use Business Intelligence Studio to create report.
  • User Parameter GUI is automatically generated by Reporting Server or manually on page.

Report Viewer Control


  • Generates a preview of the report for users
  • Allows user to print or save reports in different formats including PDF, HTML, DOC, etc
  • Requires a .NET application to host the ASP.NET Server control
  • Can use .rdlc and .rdl

Reporting Services (Standalone)


  • Useful when wanting to add Reporting Services to a .NET application because permissions can be managed using Active Directory groups/users or using service account (and delegating permissions to the .NET application).
  • Serves up .RDL files.
  • Generates preview of .RDL files
  • Provides UI to manage
    • Permissions on report
      • Individual accounts
      • Active Directory Groups
    • Schedule delivery of report
    • DataSource

Reporting Services (SharePoint Integration)

  • Useful when wanting to add Reporting Services to a SharePoint site because permissions can be managed using SharePoint groups instead of Active Directory groups as with the standalone installation of Reporting Services.
  • Serves up .RDL files still done by Reporting Services
  • Generates preview of .RDL files still done by Reporting Services
  • SharePoint provides the following UI (instead of Reporting Services) to manage
    • Permissions on report
    • Schedule delivery of report
    • DataSource

Report Builder

  • Report Builder can be used to edit .RDL files (not .RDLC)
  • Report Builder is almost identical in functionality to BIDS (Business Intelligence Development Studio). 
  • The most noticeable difference is the lack of Intellisense.
  • The UI is also more geared to be more end user vs. developer friendly.
  • Report Builder is available as an install or as a ClickOnce installation.




Tuesday, October 8, 2013

How to work around issue with using Visual Studio 2012 / Web Application to create a .rdlc report using Report Viewer Control

I don't know what I am missing, but as far as I can tell the Report Viewer in Visual Studio 2012 does NOT work properly when using a ASP.NET Web Forms Application. Notice I said APPLICATION, not Web SITE. To clarify, there is no issue you create a ASP.NET Web Forms Site Here is the scenario I will propose a work around to.

  1. Open Visual Studio 2012
  2. Create a new ASP.NET Web Forms Application (This is the critical choice to make this break)
  3. Create a report and call it Report1.rdlc
  4. Open your default page. The master page should have a Script Manager on it already. If it doesn't then you will need to add it.
  5. Drag the ReportViewer control from the Toolbox to the content area on the Default page (or other page).
  6. Use the SmartTag (the little box with a triangle in it on the upper right corner of the ReportViewer control to choose your report. This will create an ObjectDataSource with the improper configured.
  7. You can verify the ObjectDataSource is configured improperly by clicking the Refresh Schema task on the Smart Tag of the ObjectDataSource. It will generate an error similar to:

    The 'AdventureWorks2008R2DataSetTableAdapters.SalesOrderDetailTableAdapter' could not be loaded. If the type is located in teh App_Code folder, please check that it compiles. If the type is located in a complied assembly, please check that the assembly is referenced by the project.

    The type 'AdventureWorks2008R2DataSetTableAdapters.SalesOrderDetailsTableAdapter' could not be found'
  8. Reconfigure the ObjectDataSource and you will see that the problem is that it should have the namespace before the type (that it can't find). It is as if the Microsoft developer that did this functionality didn't realize the ObjectDataSource that would be created is different depending if you are using a ASP.NET Web Forms Application or a ASP.NET Web Forms Site.

  9. Run the application and you will get an error similar to this:

    An error occurred during local report processing.The report definition for report 'Report1' has not been specified Object reference not set to an instance of an object.
  10. To fix that issue, you need to select the Report Viewer and look at the Properties pane. 
  11. Scroll down to where it says LocalReport and expand that area using the Plus sign (+).
  12. Set the ReportPath property to Report1.rdlc (or whatever the filename is of your report).
  13. Run the application again. This time it will hopefully work. 

Alternatives
  1. Do everything in code.
  2. Don't use the smart tag - Create the ObjectDataSource first and make the bindings to the Collection and ReportPath yourself using the Properties panel (not the smart tag since the bug seems to be in the Smart Tag of the ReportViewer).