0% found this document useful (0 votes)
125 views

Demo Script: What'S New in Sharepoint 2010 Excel Services

This demo shows how to publish an Excel workbook to SharePoint 2010 Excel Services. It includes three key segments: 1. Exploring Excel Services 2010 - Demonstrates publishing a sample workbook with PivotTables, charts, and cube functions to Excel Services. 2. Using the REST API - Shows examples of using the REST API with Excel Services. 3. Using ECMAScript in a Web Part Page - Demonstrates including JavaScript in a web part page with an Excel workbook in Excel Services.

Uploaded by

Tola Dy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Demo Script: What'S New in Sharepoint 2010 Excel Services

This demo shows how to publish an Excel workbook to SharePoint 2010 Excel Services. It includes three key segments: 1. Exploring Excel Services 2010 - Demonstrates publishing a sample workbook with PivotTables, charts, and cube functions to Excel Services. 2. Using the REST API - Shows examples of using the REST API with Excel Services. 3. Using ECMAScript in a Web Part Page - Demonstrates including JavaScript in a web part page with an Excel workbook in Excel Services.

Uploaded by

Tola Dy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Demo Script

What's New in SharePoint 2010 Excel Services


Lab version: 1.0.0
Last updated: 12/8/2021
Content
OVERVIEW................................................................................................................................................. 3
Key Messages......................................................................................................................................... 3
Key Technologies.................................................................................................................................... 3
Time Estimates........................................................................................................................................ 3

SETUP AND CONFIGURATION................................................................................................................. 3


Task 1 – Running the Configuration Wizard.........................................................................................4

OPENING STATEMENT............................................................................................................................. 6

STEP-BY-STEP WALKTHROUGH............................................................................................................. 7
Segment #1 – Exploring Excel Services 2010......................................................................................... 7
Segment #2 – Using the REST API....................................................................................................... 10
Segment #3 – Using the ECMAScript Object Model..............................................................................12

SUMMARY................................................................................................................................................ 15
Overview
This document provides setup documentation, step-by-step instructions, and a written script for showing how to publish a workbook to Excel
Services. This document can also serve as a tutorial or walkthrough of the technologies being exposed.

Key Messages
1. Excel 2010 integrates easily with SharePoint 2010 using Excel Services.
2. SharePoint 2010 provides new APIs for Excel Services for custom development.

Key Technologies
This demo uses the following technologies:
1. Microsoft SQL Server 2008 R2
2. Microsoft SharePoint Server 2010
3. Microsoft Excel 2010

Time Estimates
Estimated time for setting up and configuring the demo: 3 min.
Estimated time to complete the demo: 15 min.

Setup and Configuration


System Requirements
Microsoft SQL Server 2008 R2
Microsoft SharePoint Server 2010
Microsoft Excel 2010
Sample Databases for Microsoft SQL Server 2008 R2
◦ Adventure Works DW 2008R2 Analysis Services database
◦ AdventureWorksDW2008R2 sample database
The setup and configuration for this demo involves running the Configuration Wizard tool included with the training kit. After going through this
demo, you can run the Cleanup.cmd script to revert any changes made to your system.

Task 1 – Running the Configuration Wizard


The following steps describe how to run the Configuration Wizard tool included with the demo to verify that all the prerequisites are properly
installed.
1. Browse to the Setup folder in the Source folder of this demo, and run the Setup.cmd script. This script will launch the Configuration
Wizard for the demo. The Configuration Wizard is designed to check your computer to ensure that it is properly configured with all of
the dependencies needed to run the demo.
2. Click through the steps in the Configuration Wizard to get to the Detecting Required Software step; a scan of prerequisites will be
performed on your computer. If you do not have the necessary dependencies, install them using the links provided by the tool and
rescan your computer.
Figure 1
Dependencies check completed successfully

3. Once the required software is properly installed click Next to configure your computer for this demo. A script will be executed to
create the SharePoint2010InsightsDemo SharePoint site used in this demo.
Figure 2
Configuration Wizard tasks

Opening Statement
Today I would like to walk you through a demonstration to show you how to publish an Excel workbook to Excel Services in SharePoint 2010.
In this demo you will specifically see these things:
1. The steps to publish a workbook to Excel Services
2. The user interface for Excel Web Access to view an Excel workbook
3. Examples of using the REST API
4. The use of a JavaScript file with an Excel workbook in Excel Services
Step-by-Step Walkthrough
This demo is composed of the following segments:
1. Exploring Excel Services 2010
2. Using the REST API
3. Using ECMAScript in a Web Part Page

Segment #1 – Exploring Excel Services 2010

Action Script Screenshot


1. Open up the Reseller Sales Let us take a closer look at Excel
by Category and Year.xlsx Services 2010 through a
workbook in Excel 2010 located demonstration. I have here a
inside the Assets folder in the workbook that is connected to an
Source folder of this demo. Analysis Services cube.
2. Click Enable Content to In this workbook, I have a PivotTable, a
enable the data connections in the PivotChart, a table, and a chart that is
document. based on data that uses CUBE
3. Open each sheet in the functions to get data from Analysis
workbook to display the contents, Services.
then return to the PivotTable sheet. I want to share this workbook to Excel
4. Click the File menu, select Services, so I am going to publish
Save & Send. Select Save to this. Click File menu, click Save &
SharePoint, and then click the Save Send, click Save to SharePoint, and
As button. then click the Save As button.
5. In the File Name box, type Then I would need to navigate to the
URL of the site. This would be my
SharePoint2010InsightsDemo site SharePoint2010InsightsDemo site.
that was created during the setup I would select the location or the
operation of this demo. Hit ENTER to particular document library where I
navigate to the site. want to store this. Before I click Save
Note: The URL for the I want to show you that I have some
SharePoint2010InsightsDemo site will additional options here. Open with
depend on the SharePoint site collection Excel in the browser is selected by
you choose during the setup operations default, so that means once I publish
of this demo. For example, if you used this I can actually view it in the excel
http://<servername>/ as the site services environment to make sure
collection, the URL of the site would be everything functions as it should.
http://<servername>/SharePoint2010I Therefore, if there are any data
nsightsDemo. refresh issues I would be able to
know that right away.
6. Select the Documents
There is also an Publish Options button
library.
here and that helps me select what I
7. Highlight the additional
want to publish. Everything is going to
options at the bottom of the window.
go by default, but I can be selective
8. Click the Publish Options
about which particular sheets I can
button. Open up the dropdown list
pick and choose, what I want to
and demonstrate the various options
publish here, or I can select particular
available. End by selecting Entire
items in the workbook. After I make
Workbook in the dropdown, and click
my selection, I click OK, click Save
OK. Click Save.
and that will publish this out to
9. Click on a cell in the newly
SharePoint.
opened PivotTable and try to type to
The PivotTable opens up in a browser
show lack of Read capability.
window; this is completely within the
Demonstrate similar capabilities of
browser. It looks very similar to
drilldown as in the Excel client.
working in my excel environment, the
10. Click the arrow in the Row
difference is when I click on a cell
Labels cell to show the list that
there is no read capability. I cannot
appears for filtering.
type into these cells, but I can browse
11. Select Product from the list,
this pivot table just as if I were inside
select Label Filters, and then select
the Excel client. I can drill down or
Contains. Type Silver into the
drill up.
search, and then click OK. Expand to
The filtering capability is slightly
the Products level to see that the
different. I need to click on the row
products displayed all have silver in
labels or the column labels to access
the name.
the filtering capability.
12. Click the Details button on
However, if I wanted to search, for
the yellow bar at the top of the page.
example, for all of my products that
13. Click each sheet of the
had the word ‘Silver’ in there I could
workbook to demonstrate the
just do a simple search here, make a
rendering.
filter and now my workbook displays
14. On the PivotChart sheet,
those products that have that word in
scroll down to the PivotTable and
there. I can do label searches, I can
change the filter to a different value to
show the PivotChart is interactive. do filters based upon values, I can do
15. On the Table sheet, use the sorting, ascending sorts, descending
dropdown in column B to select 2 or 3 sorts, and so forth. That kind of
products. capability or that kind of interactivity is
what I get with my pivot table
published out to Excel. Then
depending on how you configure
security, you can have the user Open
in Excel, refresh the data, or there are
lots of different options that you can
do. But now that it's up and available
in Excel it can be included as a web
part in a dashboard or used as
sources for charts or all kinds of
things because it is accessible
through Excel Services. There is a
programmatic interface that I have
that gives me access to these objects
through any custom applications.
Notice the warning message here that
there are unsupported features in the
workbook. To learn more about what
specifically is unsupported, I can click
the Details button and I learn this
workbook contains external data
ranges, also called query tables. That
message refers to the Table sheet in
the workbook. Excel Services will try
to render the table, but will use
cached data rather than the live data
associated with the connection. In the
previous version of Excel Services,
the workbook would not render at all.
Excel Services successfully rendered
the PivotTable and the PivotChart.
The PivotChart is interactive — I can
change a filter in the related
PivotTable to update the chart.
The table shows cached data from a
query to the AdventureWorks
database. Even though the data is
cached, I can still filter the data.

Segment #2 – Using the REST API

Action Script Screenshot


1. In Internet Explorer, type the Now let us see how to interact with this
following URL fragment: workbook using the REST API. We
http://<sharepointsite>/_vti_bin/Ex do not have to write code. We just
celRest.aspx. use a URL to reference the item that
Note: The URL for the we want to access.
SharePoint2010InsightsDemo site will First, I need to specify the ASPX page
depend on the SharePoint site collection for the REST service.
you choose during the setup operations Then I need the path to the document,
of this demo. For example, if you used including the document library name,
http://<servername>/ as the site the workbook name, and the file
collection, the URL of the site would be extension.
http://<servername>/SharePoint2010I When I do not know the name of the
nsightsDemo. resources in a workbook, I can use
REST to explore the workbook by
1. Continue building the URL by
accessing the model page.
adding the following to the URL:
The model page is an ATOM feed that
/Documents/Reseller Sales by
displays the resource collections that
Category and Year.xlsx.
REST supports.
2. Finish the URL by typing:
When I click on Charts, I can see the
/model and then press ENTER to
two items that are part of the Charts
navigate to that page.
collection.
3. Click Charts.
When I click pcAnnualSales, I can see
4. Click pcAnnualSales.
the actual item rendered as an image,
5. Move the cursor to the end of
which is the default rendering format
the URL to show its structure for the
for a chart.
chart.
When I look at the URL, I can see that it
6. Click Back twice to return to
has appended some more
the model.
information to the model URL that I
7. Click Tables, and then click
originally used. It has the name of the
tProducts.
resource collection — Charts — and
8. In the URL, replace atom with
the name of the item in parentheses
html.
9. Click Back three times to and quotes — (‘pcAnnualSales’). It
return to the model. also has a format command – ?
10. Click PivotTables, and then $format=image – which tells the
click ptCategoriesYear. browser how to render the item that I
11. In the URL, replace atom with have selected.
html. If I go back to look at other items, such
as tables, I can see that the render
format is atom, but that is not
showing correctly here in Internet
Explorer. If I change the format to
html, I can see the HTML rendering
for the table.
Similarly, I can view PivotTables. When
I use the REST API to access the
PivotTable, I cannot use any of the
interactive functionality that I can use
in Excel Web Access.
The REST API is just a simple way for
me to retrieve individual items in a
workbook that I can embed in other
applications, such as a blog post, or a
PowerPoint slide, or any application
that allows me to insert a link.

Segment #3 – Using the ECMAScript Object Model

Action Script Screenshot


1. In Internet Explorer, open Now let us see how to use the
the SharePoint2010InsightsDemo ECMAScript object model.
site. I am going to create a Web part page
Note: The URL for the called ProductSales.
SharePoint2010InsightsDemo site will Then I will add an Excel Web Access
depend on the SharePoint site collection Web part.
you choose during the setup operations I will open the tool pane to configure the
of this demo. For example, if you used Web part by linking to my workbook.
http://<servername>/ as the site Notice the other properties in the tool
collection, the URL of the site would be pane that you can use to restrict the
http://<servername>/SharePoint2010I actions that the users can perform.
nsightsDemo. To work with ECMAScript, I need to add
it using a Content Editor Web part.
1. Click the Dashboard link.
Next, I need to upload my
2. On the ribbon, click
ECSMAScript as a text file to a
Documents ribbon tab, click the
trusted location in SharePoint.
arrow next to New Document, and
We can view the file by clicking on its
then click Web Part Page.
link after adding it to the document
3. In the Name box, type
library. Here we can see the text file
ProductSales, and then click the
contains HTML, including a
Create button.
JavaScript block. It includes a handler
4. In the Header section, click
for loading the page. We can see in
Add a Web Part.
page load that it is interacting with the
5. In the Categories pane, click
Excel Web Access namespace, and
the Business Data folder, and then
then in particular we are getting an
click Excel Web Access in the Web
item from the Excel Web Access Web
Parts pane. Click Add.
part and assigning it to a variable
6. Click the link to open the tool
called om.
pane.
Then we have various handlers. This is
7. Click the ellipsis button next
not a comprehensive list of everything
to the Workbook textbox, navigate to
that is possible with ECMAScript.
the Documents document library in
This JavaScript is a simple
the SharePoint2010InsightsDemo
application to demonstrate how you
site, and select the Reseller Sales
can catch what the user is doing with
by Category and Year workbook.
the workbook, and then you can have
Click OK.
some JavaScript to respond to those
Note: If a security warning dialog actions. In this case, we are
displays click Yes to continue. responding by writing information to
8. Click OK to close the tool the log.
pane. Now we can edit the Content Editor
9. In the Header section, click Web part to add a link to that text file.
Add a Web Part. After we stop editing the page, we can
10. In the Categories pane, click see the script start to work by logging
the Media and Content folder, and events.
then click Content Editor in the Web When I click a cell or select a range of
Parts pane. Click Add. cells, I can see the result of the script
11. Open a second tab in handlers in the log.
Internet Explorer, open the Whatever the user is doing in the Excel
SharePoint2010InsightsDemo site, Access Web part, you can capture
click the Libraries link, and then click this information and respond to it.
Documents link. Of course, you would not normally log
12. Click Add document link ( ), the results as we have done in this
click Browse, select the jsom.txt file demonstration. The purpose of this
located inside the Assets folder in application is to help you see how to
the Source folder of this demo, click work with the ECMAScript object
Open, and click OK. model.
13. Click the jsom link in the
library, and click OK in the Open
Document dialog.
14. Switch back to the first tab in
Internet Explorer.
15. Click the down arrow ( ) at
the right end of the Content Editor
Web part, and click Edit Web Part.
16. In the Content Editor pane,
click the ellipsis button to the right of
the Content Link textbox, and type
the path to the text file,
http://<sharepointsite>/Documents/
jsom.txt, and click OK twice.
17. Click the Stop Editing button.
18. Click Accessories in the
PivotTable and observe the change in
the log.
19. Select multiple cells, such as
Accessories, Bikes, Clothing and
Components, and note the change
in the log.
Summary
In this demo, you have learned how to publish an Excel workbook to Excel Services in SharePoint 2010. Additionally, you have seen the user
interface for Excel Web Access to view an Excel workbook, several examples of working with the REST API, and use of the ECMAScript Object
model in a SharePoint dashboard page.

You might also like