How to take advantage of office components in sharepoint portal server – spreadsheet


My boss confirmed it is acceptable that our website's users need MS Office 2003 installed in their local machine to interact with the Office Components in the web page.


I found the solution to avoid users modify spreadsheet data directly.


First, let's see where is the data source of the web part. After I drag spreadsheet web part to one of web part zones, we can set data source from "Data Connect..." button to select SQL Server or other type. In my scenario, I use Spreadsheet Add-in tool (http://www.microsoft.com/downloads/details.aspx?FamilyID=dc3d8474-d960-4d14-a9df-9024e39f5463&DisplayLang=en) to create data files which is required by the web part. This add-in tool generate three files which is the spreadsheet's data source files and I put them into one of the document library in SPS (add-in tool can help you finish this operation).


Second, what these three files are and how they control the web part?


1. Spreadsheet file in XML format, spreadsheet's data contents are saved here, included data format, formula etc.


2. Solution specification file, discribes where is the spreadsheet file listed above saved, connection interfaces definition and other many settings.


3. .dwp file, just like normal web part, it specifies the assembly and properties.


To create the relationship between the web part and these three files, we just click the right arrowhead of the spreadsheet web part, and select "Modify Shared Web Part", set "Solution Specification File" property with the second file's hyperlink in SPS.


To avoid users from directly modifiing the contents of the spreadsheet web part, we need add a line in Solution Specification File to lock the page, just like follows:


   <WebPartSettings>
       <XMLSSFileLocation>/myDocLib/.....</XMLSSFileLocation>


......


       <LockedDown>true</LockedDown>
   </WebPartSettings>


Want to know other detail settings about Solution Specification File, please came http://www.microsoft.com/downloads/details.aspx?FamilyId=29E1FC0C-7627-45ED-AB75-1C5080F6AC1D&displaylang=en.


After refresh the page, we will find that the spreadsheet web part is basicly same with what you see in Excel tool. Although we can change the data in our personal view, the data changed really is NOT committed to the data source file.


When we want to modify the web part's contents, just edit the first file.


It is cool, yes?

Comments (6)
  1. pasu says:

    I created 3 files using the ‘Spreadsheet Add-in’ wizard. When I tried to add the web part to a web part page I am getting an error that says, "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe."

    Can you help in resolving this issue?

  2. Elton says:

    Hi, pasu, you should modify your web.config, and change the Trust Level to full.

    You could find the definition at the end of "system.web" section and change it to:

    <trust level="Full" originUrl="" />

    Hope this helps.

    Thanks/Elton

  3. pasu says:

    Thanks Elton.

    The issue was resolved by installing ‘Office 2003 Add-in: Web Parts and Components’ on the SharePoint server.

    Lesson learnt: Read the prerequisites

  4. Elton says:

    Thanks pasu let me know this.

Comments are closed.

Skip to main content