To view a report that is stored on a report service, you need to configure your MVC application. Complete the following steps to add view page to your application. For more information about using Report Viewer, see Using C1 ReportViewer Template.
Index.cshtml |
Copy Code
|
---|---|
<head> <title>C1 MVC ReportViewer</title> @Html.C1().Styles() @Html.C1().Scripts().FlexViewer() </head> <body> @(Html.C1().ReportViewer().ServiceUrl(@"https://demos.componentone.com/ASPNET/c1webapi/4.0.20171.91/api/report") .FilePath(@"ReportsRoot/FlexCommonTasks/FlexCommonTasks.flxr").ReportName(@"Simple List")) </body> |
<DataSources>
<DataSource>
<Name>Main</Name>
<DataProvider>OLEDB</DataProvider>
<ConnectionString>Provider=SQLNCLI11;Integrated Security=SSPI;
Data Source=(localdb)\\v11.0;Initial File Name=|DataDirectory|\\C1Demo.mdf;Persist Security Info=False
</ConnectionString>
<RecordSource>Employees</RecordSource>
</DataSource>
</DataSources>