FlexViewer is available as MVC Core control that can be used in an MVC applications to view reports using C1 Web API Report Services. Complete the following steps to use the control to view a report.
Create an ASP.NET Core Web Application using Visual Studio templates. For more information, see Configuring MVC application using Visual Studio template.
Note: Once you have added the resources to ASP.NET Core application, you can license the resources and your application using the MESCIUS License Manager. For more information, see Licensing topic.
_ViewImports |
Copy Code
|
---|---|
@addTagHelper *, C1.AspNetCore.Mvc @addTagHelper *, C1.AspNetCore.Mvc.FlexViewer |
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
|
---|---|
<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:
Controller
)A new controller is added to the application within the folder Controllers.
Complete the following steps to add corresponding view for the controller.
A view is added for the controller. In the code below, we have specified the Service URL, FilePath, and Report Name.
Index.cshtml |
Copy Code
|
---|---|
<c1-report-viewer file-path="ReportsRoot/FlexCommonTasks/FlexCommonTasks.flxr" report-name="Simple List" service-url="https://developer.mescius.com/componentone/demos/aspnet/5/c1webapi/latest/api/report"> </c1-report-viewer> |
A view is added for the controller.