Reputation: 4969
I'm trying to add business object data source for RDLC report in my MVC 3.0 application.However, it couldn't allow me to add object data source to my application.
How I add object data source to my RDLC report ?
Upvotes: 3
Views: 4803
Reputation: 910
Just add an aspx page with all the functionalities you need as you would in a standard WebForms application. You will just need to add a route to it. Here is an example that will probably suite your needs:
public static void RegisterRoutes(RouteCollection routes)
{
// ...
// Some MVC routes
// ...
//Custom route for reports
routes.MapPageRoute(
"ReportRoute", // Route name
"Reports/{reportname}", // URL
"~/Reports/{reportname}.aspx" // File
);
}
Upvotes: 4
Reputation: 6130
The ReportViewer component is not intended to be used with ASP.NET MVC and is unsupported. You may checkout this example. You could have a standard WebForms page (not MVC) generate the report and then include it either with iframe inside your MVC application or have it generate the report as PDF which then could be embedded.
Then check this blog:
asp-net-mvc-handling-ssrs-reports
Handling SSRS Report in ASP.Net MVC 3
Hope this helps.
Regards
Upvotes: 3