ASP.NET MVC Controls > Controls > FlexViewer > ReportViewer > Using C1 MVC ReportViewer Template |
This topic describes how to view a FlexReport in your MVC application using C1 MVC ReportViewer template. C1 MVC ReportViewer template provides three different options by which you can preview your report in FlexViewer;
If you are working with MVC 5 application, you can use the Reports in current project option in the C1 MVC ReportViewer template to add the report to your Visual Studio application, and then view it in FlexViewer.
Once you create an application using C1 MVC Report Viewer, it automatically registers the required resources, adds the relevant Web API resources and packages to your application.
If you are working with MVC 3, 4, or ASP.NET Core Framework applications, you can only use the Report in other report service option in the C1 MVC Report Viewer template to view the report in FlexViewer. You can use this option when your report is hosted on the Web API Service project
If you are working with MVC 5 or ASP.NET Core Framework applications, you can use the Reports in SSRS server option in the C1 MVC Report Viewer template to view the SSRS report in FlexViewer. You can use this option only for the SSRS reports that are hosted on a server.
The below steps demonstrates how you can use C1 MVC ReportViewer wizard to view a report in FlexViewer control using Visual Studio template.
Note: The C1 ASP.NET MVC 5 Web Application and C1 ASP.NET Core MVC Application template for ASP.NET MVC Edition automatically registers the required resources, and adds the relevant references and packages to your application. Therefore, you can directly use the C1 MVC ReportViewer template if your application is created using ComponentOne template. |
licenses.licx |
Copy Code
|
---|---|
C1.Web.Mvc.LicenseDetector, C1.Web.Mvc C1.Web.Mvc.Viewer.LicenseDetector, C1.Web.Mvc.FlexViewer |
Note: In case you are working with ASP.NET Core application, you can license the resources and your application using the GrapeCity License Manager. For more information, see Licensing topic. |
Complete the following steps to register the required resources for using ASP.NET MVC FlexViewer control:
_Layout.cshtml
to open it.<head></head>
tags.
_Layout.cshtml |
Copy Code
|
---|---|
@Html.C1().Styles()@Html.C1().Scripts().Basic().FlexViewer() |
_Layout.cshtml |
Copy Code
|
---|---|
<c1-styles /><c1-scripts> <c1-flex-viewer-scripts /></c1-scripts> |
For more information on how to register resources for FlexViewer, refer to Registering Resources.
Complete the following steps to add controller to your application.
A new controller is added to the application within the folder Controllers.
Controller
)A new controller is added to the application within the folder Controllers.
Views for the ReportViewer is discussed in the following topics:
Back to Top