0

I want to use SSRS report in my Boiler Plate application. To achieve this, I am not able to add a web form to include report viewer for RDLC report. Could you please share some examples?

Murali
  • 11

1 Answers1

2

If you just need to add a new asp.net web form then in a MVC project it's possible to add a new aspx page.

Since .aspx files don't user Razor, and you can't tell it to use the _Layout page.. so you need the layout html.

If you want to check user permission as well, you can see the sample code below;

public partial class CrystalReportViewer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IocManager.Instance.IocContainer.Resolve<IPermissionChecker>().IsGranted("Pages.CrystalReports"))
        {
            throw new Exception("You are not authorized");
        }

        //Show report otherwise
    }
}

There further information about this issue. you can read them

http://www.codedigest.com/posts/3/adding-aspnet-webforms-into-aspnet-mvc-project-and-vice-versa

How to add .aspx pages to existing MVC 4 project?

https://www.linkedin.com/pulse/integrate-sap-crystal-reports-aspnet-mvc5-application-koutroumpas/

Alper Ebicoglu
  • 8,884
  • 1
  • 49
  • 55