Office Web Components are ActiveX controls. You cannot add them to a web page through the WebForms designer. That is why they are disabled (grayed out). WinForms can host ActiveX controls, so components are not disabled when forms are developed.
To add a pivot table to a web page, use the object element and specify the classid from "clsid: 0002E55A-0000-0000-C000-000000000046". See examples below.
Example
The following is the resulting code when adding a pivot table to a web page using FrontPage 2003.
<object classid="clsid:0002E55A-0000-0000-C000-000000000046" id="PivotTable1"> <param name="XMLData" value="<xml xmlns:x="urn:schemas-microsoft-com:office:excel"> <x:PivotTable> <x:OWCVersion>11.0.0.8304 </x:OWCVersion> <x:DisplayScreenTips/> <x:CubeProvider>msolap.2</x:CubeProvider> <x:CacheDetails/> <x:PivotView> <x:IsNotFiltered/> </x:PivotView> </x:PivotTable> </xml>"> <table width="100%" cellpadding="0" cellspacing="0" border="0" height="8"> <tr> <td bgcolor="#336699" height="25" width="10%"> </td> <td bgcolor="#666666" width="85%"><font face="Tahoma" color="white" size="4"><b> Missing: Microsoft Office Web Components</b></font></td> </tr> <tr> <td bgcolor="#cccccc" width="15"> </td> <td bgcolor="#cccccc" width="500px"><br> <font face="Tahoma" size="2">This page requires the Microsoft Office Web Components.<p align="center"> <a href="D:/ENGLISH/OFFICE_SYSTEM/OFFICEPRO2003/files/owc11/setup.exe">Click here to install Microsoft Office Web Components.</a>.</p></font><p><font face="Tahoma" size="2">This page also requires Microsoft Internet Explorer 5.01 or higher.</p><p align="center"><a href="http://www.microsoft.com/windows/ie/default.htm"> Click here to install the latest Internet Explorer</a>.</font><br> </td> </tr> </table> </object>
The following is the resulting code when adding a pivot table to a web page using SharePoint Designer 2007.
<object classid="clsid:0002E55A-0000-0000-C000-000000000046" id="PivotTable1"> <param name="XMLData" value="<xml xmlns:x="urn:schemas-microsoft-com:office:excel"> <x:PivotTable> <x:OWCVersion>11.0.0.8304 </x:OWCVersion> <x:DisplayScreenTips/> <x:CubeProvider>msolap.2</x:CubeProvider> <x:CacheDetails/> <x:PivotView> <x:IsNotFiltered/> </x:PivotView> </x:PivotTable> </xml>" /> </object>
Below is the resulting code using Microsoft Excel 2003 Save as a web page with the "Add interactivity" check.
<div id="Book1_31522" align=center x:publishsource="Excel"><object id="Book1_31522_Spreadsheet" classid="CLSID:0002E559-0000-0000-C000-000000000046"> <param name=DisplayTitleBar value=false> <param name=Autofit value=true> <param name=DataType value=XMLData> <param name=XMLData value="[AMJ - REMOVED FOR POSTING]"> <p style='margin-top:100;font-family:Arial;font-size:8.0pt'>To use this Web page interactively, you must have Microsoft® Internet Explorer 5.01 Service Pack 2 (SP2) or later and the Microsoft Office 2003 Web Components.</p> <p style='margin-top:100;font-family:Arial;font-size:8.0pt'>See the <a href="http://r.office.microsoft.com/r/rlidmsowcpub?clid=1033&p1=Excel">Microsoft Office Web site</a> for more information.</p> </object></div>
source share