This procedure describes how to create two Spreadsheet Web Parts that implement Web Part connection interfaces. To make the example clearer, it assumes you are creating these two Web Parts by using the Suppliers and Products tables from the Northwind sample database on Microsoft SQL Server:
Because a one-to-many relationship exists between the Suppliers and Products tables on the SupplierID column, these two Web Parts can be connected to provide the SupplierID value from the Suppliers Web Part to filter the rows displayed in the Products Web Part. However, you can create similar Web Parts by using any data source that has a one-to-many relationship based on a single column.
Note You can make the process of creating a Spreadsheet Web Part simpler by using the Spreadsheet Web Part Add-in for Microsoft Office Excel 2003. This add-in is available for download from the Microsoft Download Center Web Site.
Create a row provider Spreadsheet Web Part
<?xml version="1.0"?>
<SolutionSpecification
xmlns="http://schemas.microsoft.com/WebPart/v2/Spreadsheet/SolutionSpecification">
<WebPartSettings>
<XMLSSFileLocation>URLToXMLSpreadsheetFile
</XMLSSFileLocation>
<LockedDown>True</LockedDown>
</WebPartSettings>
<InterfaceConnections>
<RowProvider Name="RowProvider1_WPQ_"
MaxConnections="-1"
MenuLabel="Provide selected row"
Description="Sends the selected row to another Web Part.">
<SendRow>
<MapEntryID>Insert Map/Entry@ID</MapEntryID>
</SendRow>
</RowProvider>
</InterfaceConnections>
</SolutionSpecification>
Where Insert Map/Entry@ID is the value of the ID attribute value from the <Entry> tag contained within the <Map> tag for the mapped table in the XML Spreadsheet file.
Create a filter consumer Spreadsheet Web Part
<?xml version="1.0"?>
<SolutionSpecification
xmlns="http://schemas.microsoft.com/WebPart/v2/Spreadsheet/SolutionSpecification">
<WebPartSettings>
<XMLSSFileLocation>URLToXMLSpreadsheetFile
</XMLSSFileLocation>
<LockedDown>True</LockedDown>
</WebPartSettings>
<InterfaceConnections>
<FilterConsumer Name="RowConsumer1_WPQ_"
MaxConnections="-1"
MenuLabel="Get Filter From"
Description="Filters products by the selected SupplierID value.">
<LocalFilter>
<MapEntryID>Insert Map/Entry@ID</MapEntryID>
</LocalFilter>
</FilterConsumer>
</InterfaceConnections>
</SolutionSpecification>
Where Insert Map/Entry@ID is the value of the ID attribute value from the <Entry> tag contained within the <Map> tag for the mapped table in the XML Spreadsheet file.
Import and connect the Web Parts