SharePoint2010Excelservice

download SharePoint2010Excelservice

of 15

Transcript of SharePoint2010Excelservice

  • 8/7/2019 SharePoint2010Excelservice

    1/15

    Demo Script

    What's New in SharePoint 2010 Excel Services

    Lab version: 1.0.0

    Last updated: 3/5/2011

  • 8/7/2019 SharePoint2010Excelservice

    2/15

    CONTENTS

    OVERVIEW ............................................................................................................................................. 3Key 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 .......................................................................................................... 7Segment #1 Exploring Excel Services 2010 ...................................................................................... 7

    Segment #2 Using the REST API ...................... ............................ ......................... ......................... 10

    Segment #3 Using the ECMAScript Object Model .................................. .......................... ............... 12

    SUMMARY ............................................................................................................................................ 15

  • 8/7/2019 SharePoint2010Excelservice

    3/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.M

    icrosoft SharePoint Server 20103. Microsoft Excel 2010

    Time Estimates

    y Estimated time for setting up and configuring the demo: 3 min.

    y Estimated time to complete the demo: 15 min.

    Setup and Configuration

    System Requirements

    y Microsoft SQL Server 2008 R2

  • 8/7/2019 SharePoint2010Excelservice

    4/15

    y Microsoft SharePoint Server 2010

    y Microsoft Excel 2010

    y Sample Databases forMicrosoft 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.

    Task1 Running theConfiguration 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 ofthe dependencies needed to run the demo.

    2. Click through the steps in the Configuration Wizard to get to theDetecting 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.

  • 8/7/2019 SharePoint2010Excelservice

    5/15

    Figure1

    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.

  • 8/7/2019 SharePoint2010Excelservice

    6/15

    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

  • 8/7/2019 SharePoint2010Excelservice

    7/15

    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 byCategory and Year.xlsx workbook inExcel 2010 located inside the Assetsfolder in the Source folder of thisdemo.

    2. Click Enable Content to enable thedata connections in the document.

    3. Open each sheet in the workbook todisplay the contents, then return to

    the PivotTable sheet.

    4. Click the File menu, select Save &Send. Select Save to SharePoint,and then click the Save As button.

    5. In the File Name box, type URL ofthe SharePoint2010InsightsDemo

    y Let us take a closer look at ExcelServices 2010 through ademonstration. I have here aworkbook that is connected to anAnalysis Services cube.

    y In this workbook, I have a PivotTable,a PivotChart, a table, and a chart thatis based on data that uses CUBEfunctions to get data from AnalysisServices.

    y I want to share this workbook to ExcelServices, so I am going to publishthis. Click File menu, click Save &Send, click Save to SharePoint, andthen click the Save As button.

    y Then I would need to navigate to thesite. This would be my

  • 8/7/2019 SharePoint2010Excelservice

    8/15

    site that was created during the setupoperation of this demo. Hit ENTER tonavigate to the site.

    Note: The URL for theSharePoint2010InsightsDemo site willdepend on the SharePoint site collectionyou choose during the setup operationsof this demo. For example, if you usedhttp:/// as the sitecollection, the URL of the site would be

    http:///SharePoint2010InsightsDemo.

    6. Select the Documents library.

    7. Highlight the additional options at thebottom of the window.

    8. Click the Publish Options button.Open up the dropdown list anddemonstrate the various optionsavailable. End by selecting EntireWorkbook in the dropdown, and clickOK. Click Save.

    9. Click on a cell in the newly openedPivotTable and try to type to show

    lack of Read capability. Demonstratesimilar capabilities of drilldown as inthe Excel client.

    10. Click the arrow in the Row Labelscell to show the list that appears forfiltering.

    SharePoint2010InsightsDemo site.

    y I would select the location or theparticular document library where Iwant to store this. Before I click SaveI want to show you that I have someadditional options here. Open withExcel in the browser is selected bydefault, so that means once I publishthis I can actually view it in the excelservices environment to make sure

    everything functions as it should.Therefore, if there are any datarefresh issues I would be able toknow that right away.

    y There is also an Publish Optionsbutton here and that helps me selectwhat I want to publish. Everything isgoing to go by default, but I can be

    selective about which particularsheets I can pick and choose, what Iwant to publish here, or I can selectparticular items in the workbook. AfterI make my selection, I click OK, clickSave and that will publish this out toSharePoint.

    y The PivotTable opens up in a

    browser window; this is completelywithin the browser. It looks verysimilar to working in my excelenvironment, the difference is when Iclick on a cell there is no readcapability. I cannot type into thesecells, but I can browse this pivot tablejust as if I were inside the Excelclient. I can drill down or drill up.

  • 8/7/2019 SharePoint2010Excelservice

    9/15

    11. Select Product from the list, selectLabel Filters, and then selectContains. Type Silverinto thesearch, and then click OK. Expand tothe Products level to see that theproducts displayed all have silver inthe name.

    12. Click the Details button on the yellowbar at the top of the page.

    13. Click each sheet of the workbook todemonstrate the rendering.

    14. On the PivotChart sheet, scroll downto the PivotTable and change thefilter to a different value to show thePivotChart is interactive.

    15. On the Table sheet, use thedropdown in column B to select 2 or 3products.

    y The filtering capability is slightlydifferent. I need to click on the rowlabels or the column labels to accessthe filtering capability.

    y However, if I wanted to search, forexample, for all of my products thathad the word Silver in there I couldjust do a simple search here, make afilter and now my workbook displays

    those products that have that word inthere. I can do label searches, I cando filters based upon values, I can dosorting, ascending sorts, descendingsorts, and so forth. That kind ofcapability or that kind of interactivity iswhat I get with my pivot tablepublished out to Excel. Thendepending on how you configuresecurity, you can have the user Open

    in Excel, refresh the data, or there arelots of different options that you cando. But now that it's up and availablein Excel it can be included as a webpart in a dashboard or used assources for charts or all kinds ofthings because it is accessiblethrough Excel Services. There is aprogrammatic interface that I have

    that gives me access to these objectsthrough any custom applications.

    y Notice the warning message herethat there are unsupported features inthe workbook. To learn more aboutwhat specifically is unsupported, I canclick the Details button and I learnthis workbook contains external data

  • 8/7/2019 SharePoint2010Excelservice

    10/15

    ranges, also called query tables. Thatmessage refers to the Table sheet inthe workbook. Excel Services will tryto render the table, but will usecached data rather than the live dataassociated with the connection. In theprevious version of Excel Services,the workbook would not render at all.

    y Excel Services successfully renderedthe PivotTable and the PivotChart.

    The PivotChart is interactive I canchange a filter in the relatedPivotTable to update the chart.

    y The table shows cached data from aquery to the AdventureWorksdatabase. Even though the data iscached, I can still filter the data.

    Segment #2 Using the REST API

    Action Script Screenshot

  • 8/7/2019 SharePoint2010Excelservice

    11/15

    1. In Internet Explorer, type the

    following URL fragment:http:///_vti_bin/ExcelRest.aspx.

    Note: The URL for theSharePoint2010InsightsDemo site willdepend on the SharePoint site collectionyou choose during the setup operationsof this demo. For example, if you used

    http:/// as the sitecollection, the URL of the site would behttp:///SharePoint2010InsightsDemo.

    2. Continue building the URL by addingthe following to the URL:/Documents/Reseller Sales byCategory and Year.xlsx.

    3. Finish the URL by typing: /model andthen press ENTER to navigate to thatpage.

    4. Click Charts.

    5. Click pcAnnualSales.

    6. Move the cursor to the end of theURL to show its structure for thechart.

    7. Click Back twice to return to themodel.

    y Now let us see how to interact with

    this workbook using the REST API.We do not have to write code. Wejust use a URL to reference the itemthat we want to access.

    y First, I need to specify the ASPXpage for the REST service.

    y

    Then I need the path to thedocument, including the documentlibrary name, the workbook name,and the file extension.

    y When I do not know the name of theresources in a workbook, I can useREST to explore the workbook byaccessing the model page.

    y The model page is an ATOM feedthat displays the resource collectionsthat REST supports.

    y When I click on Charts, I can see thetwo items that are part of the Chartscollection.

    y When I click pcAnnualSales, I cansee the actual item rendered as animage, which is the default renderingformat for a chart.

    y When I look at the URL, I can seethat it has appended some moreinformation to the model URL that I

  • 8/7/2019 SharePoint2010Excelservice

    12/15

    8. Click Tables, and then clicktProducts.

    9. In the URL, replace atom with html.

    10. Click Back three times to return tothe model.

    11. Click PivotTables, and then clickptCategoriesYear.

    12. In the URL, replace atom with html.

    originally used. It has the name of theresource collection Charts andthe name of the item in parentheses

    and quotes (pcAnnualSales). Italso has a format command ?$format=image which tells thebrowser how to render the item that Ihave selected.

    y If I go back to look at other items,such as tables, I can see that therender format is atom, but that is notshowing correctly here in InternetExplorer. If I change the format tohtml, I can see the HTML renderingfor the table.

    y Similarly, I can view PivotTables.When I use the REST API to accessthe PivotTable, I cannot use any of

    the interactive functionality that I canuse in Excel Web Access.

    y The REST API is just a simple wayfor me to retrieve individual items in aworkbook that I can embed in otherapplications, such as a blog post, or aPowerPoint slide, or any applicationthat allows me to insert a link.

    Segment #3 Using the ECMAScript Object Model

    Action Script Screenshot

  • 8/7/2019 SharePoint2010Excelservice

    13/15

    1. In Internet Explorer, open the

    SharePoint2010InsightsDemo site.

    Note: The URL for theSharePoint2010InsightsDemo site willdepend on the SharePoint site collectionyou choose during the setup operationsof this demo. For example, if you usedhttp:/// as the sitecollection, the URL of the site would be

    http:///SharePoint2010InsightsDemo.

    2. Click the Dashboard link.

    3. On the ribbon, click Documentsribbon tab, click the arrow next toNew Document, and then click Web

    Part Page.

    4. In the Name box, type ProductSales,and then click the Create button.

    5. In the Headersection, click Add aWeb Part.

    6. In the Categories pane, click theBusiness Data folder, and then clickExcel Web Access in the Web Partspane. Click Add.

    7. Click the link to open the tool pane.

    8. Click the ellipsis button next to the

    y Now let us see how to use the

    ECMAScript object model.

    y I am going to create a Web part pagecalled ProductSales.

    y Then I will add an Excel Web AccessWeb part.

    y I will open the tool pane to configurethe Web part by linking to myworkbook. Notice the other propertiesin the tool pane that you can use torestrict the actions that the users canperform.

    y To work with ECMAScript, I need toadd it using a Content Editor Web

    part.

    y Next, I need to upload myECSMAScript as a text file to atrusted location in SharePoint.

    y We can view the file by clicking on itslink after adding it to the document

    library. Here we can see the text filecontains HTML, including aJavaScript block. It includes a handlerfor loading the page. We can see inpage load that it is interacting with theExcel Web Access namespace, andthen in particular we are getting anitem from the Excel Web Access Webpart and assigning it to a variable

  • 8/7/2019 SharePoint2010Excelservice

    14/15

    Workbook textbox, navigate to theDocuments document library in theSharePoint2010InsightsDemo site,

    and select the Reseller Sales byCategory and Yearworkbook. ClickOK.

    Note: If a security warning dialogdisplays click Yes to continue.

    9. Click OK to close the tool pane.

    10. In the Headersection, click Add aWeb Part.

    11. In the Categories pane, click theMedia and Content folder, and thenclick Content Editorin the WebParts pane. Click Add.

    12. Open a second tab in InternetExplorer, open theSharePoint2010InsightsDemo site,click the Libraries link, and then clickDocuments link.

    13. Click Add document link ( ), clickBrowse, select the jsom.txt filelocated inside the Assets folder inthe Source folder of this demo, clickOpen, and click OK.

    14. Click the jsom link in the library, andclick OK in the Open Documentdialog.

    called om.

    y Then we have various handlers. Thisis not a comprehensive list ofeverything that is possible withECMAScript. This JavaScript is asimple application to demonstratehow you can catch what the user isdoing with the workbook, and thenyou can have some JavaScript torespond to those actions. In this case,we are responding by writinginformation to the log.

    y Now we can edit the Content EditorWeb part to add a link to that text file.

    y After we stop editing the page, wecan see the script start to work bylogging events.

    y When I click a cell or select a rangeof cells, I can see the result of thescript handlers in the log.

    y Whatever the user is doing in theExcel Access Web part, you cancapture this information and respond

    to it.

    y Of course, you would not normally logthe results as we have done in thisdemonstration. The purpose of thisapplication is to help you see how towork with the ECMAScript objectmodel.

  • 8/7/2019 SharePoint2010Excelservice

    15/15

    15. Switch back to the first tab in InternetExplorer.

    16. Click the down arrow ( ) at the rightend of the Content EditorWeb part,and click Edit Web Part.

    17. In the Content Editorpane, click theellipsis button to the right of theContent Link textbox, and type the

    path to the text file,http:///Documents/jsom.txt, and click OK twice.

    18. Click the Stop Editing button.

    19. Click Accessories in the PivotTableand observe the change in the log.

    20. Select multiple cells, such asAccessories, Bikes, Clothing andComponents, and note the changein the log.

    Summary

    In this demo, you have learned how to publish an Excel workbook to ExcelServices 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.