Microsoft Office Tutorials and References
In Depth Information
EWA and API Working Together
Of the two approaches, this one is easiest to implement, but it isn’t nearly as powerful as the
managedcode approach that is discussed later. Anyone who is well-versed in client-side browser scripting can
probably take this approach and make it quite impressive. The usage described here stops well short of
accomplishing anything extraordinary, but it provides a starting point and hopefully causes you to think
about what could be possible.
To implement this approach, you create a web page that contains an EWA and a Content Editor Web
Part. You then use the Content Editor Web Part to host the HTML and <script> that gets the session
ID from the EWA instance. The <script> uses the session ID to make an Excel Services web service
Before you begin, the following prerequisites must be met:
Microsoft Office SharePoint Server 2007 must be available.
Excel Services must be set up and ready to load workbooks.
An Excel workbook must be published to a trusted location where at least View permissions
You must have at least the Designer permission on a web page.
Creating a SharePoint Web Page
If you do not already have a web page where you can try out this approach, follow these steps to
Use the browser to navigate to site where you want to create the web page.
Select Site Actions
On the create.aspx page, click Web Part Page. When the New Web Part Page is displayed,
provide a name for the page. For this exercise, name the page testPage1.aspx . Choose the Full
Page template and click the Create button. The testPage1.aspx page loads in Design mode.
Click the Add A Web Part button and add two Web Parts: Context Editor Web Part and Excel
Web Access Web Part. The testpage1.aspx page now contains both Web Parts and remains in
Configure the EWA to load a default workbook by opening the Properties task pane. To do this,
click the edit link on the EWA Web Part and click Modify Shared Web Part. In the Workbook
input field, enter the full path to a workbook from a trusted location. Click OK to apply the
change. The workbook loads in the EWA.
Before moving to the coding part of this approach, you need to provide the EWA Web Part ID.
To obtain the ID, right-click the page above the Full Page label near the top of the page. Select
View Source from the IE context menu, and then search the source for the ID of the EWA Web
Part. The ID will be similar to WebPartWPQ4. Make a note of the ID, because you will need