Report Viewer Web Part Programmability in SharePoint Integration
The Report Viewer Web Part is a ReportViewerWebPart server control, which contains a set of public application programming interfaces (API) that enables developers to create custom SharePoint applications. You can create custom Web Parts that supply report path and parameters to Report Viewer Web Part using Web Part connections. You can also embed the Web Part in a custom SharePoint Web Part page and customize it using the public API.
The Report Viewer Web Part is a connection consumer to SharePoint Web Parts that implement IWebPartRow or IFilterValues. An IWebPartRow Web Part, such as the Documents Web Part can supply a report path to a Report Viewer Web Part when placed on the same Web Part page as the Report Viewer Web Part. Likewise, an IFilterValues Web Part, such as the Text Filter or the Choice Filter, can supply a report parameter to a Report Viewer Web Part when placed on the same Web Part page as the Report Viewer Web Part.
Implementing a Report Path Provider with IWebPartRow
To supply a report path to the Report Viewer Web Part through Web Part connections, do the following:
Create a Web Part that implements the IWebPartRow interface.
Add the Web Part to the same Web Part page as the Report Viewer Web Part.
Connect your Web Part to the Report Viewer Web Part in the Web-based Web Part design user interface.
You can only connect one IWebPartRow Web Part to the Report Viewer Web Part at a time, and you cannot connect both an IWebPartRow Web Part and an IFilterValues Web Part to the Report Viewer Web Part at the same time.
For your IWebPartRow Web Part to work properly with the ReportViewerWebPart, you must do the following in the GetRowData(RowCallback) method:
Invoke the callback method with a DataRowView object as the input parameter.
Make sure that the DataRowView object contains a column called "DocUrl" that contains the report path.
The Report Viewer Web Part in the add-in for Office SharePoint Server 2010 also supports receiving the report path using the "FileRef" column.
Implementing a Report Parameter Provider with IFilterValues
A Web Part that implements IFilterValues can provide one parameter value to the Report Viewer Web Part. The parameter value sent to the Report Viewer Web Part is subject to the same restrictions placed on the report parameter as specified in the report definition, such as data type, valid values, and so on
To supply a report parameter to the Report Viewer Web Part, do the following: