ReportViewer can be used in Sharepoint to make reports. To do this – place ReportViewer on the aspx page. Create rdlc report file to show some table data, for example table – “Name – Age”. Then link ReportPath property with rdlc file and add data source in the DataSources collection. As we fill these properties in code, then that example can be easy modified to work with different rdlc files and different table data. More over, we can use session to pass data source to the code from another page.
ReportViewer folder contains VS2005 project that demonstrate using of this control. The files MyReport.aspx and MyReport.aspx.cs must be copied to the “layouts” folder, the Report.rdlc file must be copied to the root of your application virtual directory, where web.config is. To run example – open in the browser your site URL, followed by the _layouts/Myreports.aspx. You will see the followed picture:
If the user do not have access to read from the root of your virtual directory an error will appear. To resolve this problem you must give users privilege to read rdlc files.