excel servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · web viewin this lab you...

26
Hands-On Lab Leveraging Excel Services in SharePoint Online Lab version: 1.0 Last updated: 3/6/2022

Upload: ngotuyen

Post on 03-May-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Hands-On Lab Leveraging Excel Services in SharePoint OnlineLab version: 1.0

Last updated: 5/8/2023

Page 2: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

CONTENTS

OVERVIEW................................................................................................................................................. 3System Requirements..............................................................................................................................3

SETUP........................................................................................................................................................ 3Task 1 – Create SharePoint Online Site................................................................................................3

Task 2 – Upload Prerequisite Solution.................................................................................................4

EXERCISE 1: USING THE CHARTING WEB PARTS...............................................................................5Task 1 – Create the Chart web part.....................................................................................................5

EXERCISE 2: PERFORMING ANALYSIS WITH EXCEL AND EXCEL SERVICES................................11Task 1 – Create the Chart web part...................................................................................................11

EXERCISE 3: USING THE EXCEL WEB VIEWER WEB PART AND THE REST API TO EXPOSE CHART DATA........................................................................................................................................... 16

Task 1 – Add an Excel Web Access Web Part.....................................................................................17

Task 2 – Discover the REST API..........................................................................................................19

Task 3 – Test Your Solution................................................................................................................22

SUMMARY................................................................................................................................................ 23

Page 3: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Overview

Lab Time: 45 minutes.

Lab Folder: C:\%Office365TrainingKit%\Labs\5.1

Lab Overview: The purpose of this lab is to demonstrate the Business Intelligence (BI) capabilities available in SharePoint Online using Excel Services. You will begin by using the Chart Web Part to create graphical representations of data within SharePoint lists. Next, you will take an existing Excel workbook that displays BI information and publish the workbook with Excel Services to make it accessible to users via the browser. Finally, you will expose Excel chart data using the REST API.

In this lab, you will be working with sales data that has been generated from the AdventureWorks database. The AdventureWorks data on sales revenue spanning six different counties.

System Requirements

You must have the following items to complete this lab:

SharePoint 2010

SharePoint Designer 2010

Visio 2010

Visual Studio 2010

SharePoint Online

◦ Note: You will need administrator access to an SPO site collection to perform the steps in this lab.

Setup

Task 1 – Create SharePoint Online Site

In this task, you will create a sub site for this lab in your SharePoint Online site. Unlike other labs, this entire lab will be performed within SharePoint Online.

1. Navigate to your top-level SharePoint Online site, e.g., https://contoso.sharepoint.com.

2. From Site Actions, choose New Site.

3. Choose the Express Site template.

4. Enter Lab05 for the name of the site to create, e.g., https://contoso.sharepoint.com/Lab05.

Page 4: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

5. Click Create to create the site.

Note: You have to be an administrator on your SharePoint Online website to perform the tasks in this lab, e.g., creating and publishing a SharePoint Designer workflow to the SharePoint Online site.

Task 2 – Upload Prerequisite Solution

In this task, you will upload a solution to SharePoint Online which will create and populate the lists that will be used later in this exercise.

1. Launch Internet Explorer and navigate to your top-level SharePoint Online site, for example, https://contoso.sharepoint.com.

2. Click Site Actions >> Site Settings.

3. Under Galleries, click on the Solutions link to view the site collection’s Solution Gallery.

4. Click on the Solutions tab in the ribbon to view the Upload Solution button.

5. Click the Upload Solution button.

6. Browse to C:\%Office365TrainingKit%\Labs\5.1\Source\After\Visual Studio\OfficeServices.Setup.wsp and click Open and OK.

7. In the Solution Gallery – Activate Solution dialog, click the Activate button on the Ribbon to activate the solution.

Note: Activating the solution will close the dialog automatically.

8. Browse to the Lab05 site.

9. Click Site Actions >> Site Settings and under the Site Actions group choose Manage Site Features.

Page 5: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

10. Activate the OfficeServices.Setup Feature1 feature.

11. The Revenue By Country list should now be visible in the Quick Launch.

Exercise 1: Using the Charting Web Parts

In this exercise, you will display the AdventureWorks data using the Chart Web Part pulling the data from Revenue By Country list within your SharePoint Online site.

Task 1 – Create the Chart web part

In this task you will use the Chart Web Part to provide a simple way to provide charts to a Web Part page so that users can visualize data in native lists within a SharePoint site.

1. Using the browser, navigate to the Lab05 site.

2. In the Quick Launch, you should see that there a list that has been created in the site named Revenue By Country. Click on the links to quickly inspect the data inside.

3. Go back to the home page of Lab05.

4. Add an instance of the Chart Web Part using the following steps.

a. Select Site Actions » Edit Page to place the page into edit mode.

b. Click on the Add a Web Part button inside the Rich Content Zone.

c. Select the Chart Web Part from the Business Data folder and click the Add button place it on the page.

Page 6: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

5. Once the Chart Web Part has been added to the page, you should see a link with the caption of Data & Appearance. Click on this link to launch a wizard that will allow you to select a data source.

6. Follow these steps to move through the wizard and connect the Chart Web Part to a SharePoint list as its data source.

a. On the first page of the wizard, click the link Connect chart to data.

b. Now select a data source. Choose Connect to a List and click Next.

c. The next page asks you to pick a site and a list. Leave the current site as the selected site and make sure Revenue by Country is selected as the target list. Click Next.

Page 7: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

d. The next page shows you the data from the list but requires no action. Click Next.

e. The final step of the wizard allows you to bind your chart to the data. Fill out this page as shown in the screenshot below (these should all be default settings on this screen) and click Finish.

7. At this point you should have a basic column chart. Now you need to convert it into a pie chart

and make it look more polished. Click the Data & Appearance link again and do the following:

a. On the first page of the wizard click Customize Your Chart.

b. The next page allows you to pick a chart type. Under Chart Type Categories select Pie. Select the 2D Chart Types tab and select the first chart type with the caption of Pie.

c. Click Next.

Page 8: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

d. The next page allows you to change visual aspects of the chart. Change the Chart Width

from 300px to 800px. Change the Chart Height from 300px to 400px.

e. Click Next.

f. On the next page, click the checkbox which reads Show Legend. Add a legend title of "Revenue By Country”.

g. Click Finish to complete the wizard and to see the chart which should look like the one

shown below.

Page 9: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

8. Now you will add a second instance of the Chart Web Part to default.aspx so you can also chart

the sales data inside the Revenue by Country list.

a. Select Site Actions » Edit Page command to place the page into edit mode.

b. Select Insert >> Web Part

c. Select the Chart Web Part from the Business folder and click the Add button place it on the page.

Page 10: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

9. At this point the new Chart Web Part instance should appear above the Pie Chart Web Part you created earlier. Now configure this following these directions:

a. Click on the Data & Appearance link on new Chart Web Part instance so you can select a data source.

b. On the first page of the wizard, click the link which reads Connect Chart To Data.

c. The next page asks you to select a data source. Choose Connect to a List and click Next.

d. The next page asks you to pick a site and a list. Leave the current site as the selected site and select Revenue By Country as the target list.

e. Click Next.

f. The next page shows you the data from the list but requires no action.

g. Click Next.

h. The next and final step of the wizard allows you to bind your chart to the data. Fill out this page as the screenshot shown below and click Finish.

10. Once you have finished this task, your chart should now look like this:

Page 11: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Exercise 2: Performing Analysis with Excel and Excel Services

In this exercise you will work with the Microsoft Office Excel 2010 client application. Throughout this exercise you will utilize the Excel client integration points in SharePoint sites and Excel Services.

Task 1 – Create the Chart web part

1. In the browser, navigate to the site at the Lab05 sub site, e.g., https://contoso.sharepoint.com/Lab05.

2. Create a new document library named Excel Workbooks so you have a location to publish Excel workbooks.

a. Select Site Actions » New Document Library.

b. Name the document library Excel Workbooks and configure it to have a Document Template of type Microsoft Excel spreadsheet.

c. Click the Create button.

3. At this point, you should be at the page with the default view for the Excel Workbooks document library. Click on the Documents tab in the contextual Library Tools menu of the ribbon, and then click on the Upload Document button.

Page 12: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

4. Select the file C:\%Office365TrainingKit%\Labs\5.1\Source\Before\Ex2Before.xls. This file contains similar revenue information to the data contained within the list in the previous exercise.

5. Once you have uploaded the file, click the dropdown next to the document and select Edit in Microsoft Excel to open it in Excel.

6. Now it is time to begin work inside the workbook. Begin by creating a chart from this data.

a. Select the range of cells to include the first and third columns of data, as seen in the image below

b. In the ribbon, select the Insert tab.

c. Drop down the Pie menu and select the first Pie chart.

Page 13: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

7. Once you have created the chart, you will need to resize and relocate it. Take a few moments to

apply formatting to the worksheet by adding chart titles, legends, etc.

8. Now save your work using the standard Excel Save command.

9. Name the workbook Ex2Before.xls, and save it in the Excel Workbooks document library, e.g., https://contoso.sharepoint.com/Lab05/Excel%20Workbooks.

Page 14: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

10. Now you will publish the workbook to Excel Services using the following steps.

a. Select the File button (i.e. the green button at the top-left of the screen).

b. In the left column, click on Save & Send.

c. In the middle column click on Save to SharePoint.

d. In the right column click the Current Location of Excel Workbooks (see image below).

e. Click Save As.

f. The Save As dialog appears. Unlike the usual Save As dialog, this dialog has a button in the bottom section with the caption Publish Options…. Click this button to display the Excel Services Publish Options dialog.

Page 15: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

g. In the Show tab, change the value of the dropdown list from Entire Workbook to Items in Workbook. This dialog allows users to select what they would like published using Excel Services.

h. Unselect all checkboxes except Chart 2 so that only the chart is published.

i. Click OK to save your changes and dismiss the Excel Services Options dialog.

j. Click Save in the Save As dialog to publish the workbook to Excel Services. If you receive a prompt asking you if you want to overwrite the existing file, confirm by clicking OK.

Page 16: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

After you complete this step Excel will begin the publishing process. If this is the first time Excel Services has been started, it may take a minute to complete. When the publishing process is completed, you should now see your chart inside the browser.

Exercise 3: Using the Excel Web Viewer Web Part and the REST API to Expose Chart Data

In Exercise 3, you will use the Excel Web Viewer Web Part and REST API to display charts that are based upon the revenue data without exposing the underlying data. Excel Services provides 3 APIs with which developers can access and manipulate Excel document information.

1. ECMAScript (JavaScript, JScript) Object Model – The ECMAScript object model is new to SharePoint 2010. The ECMAScript object model in Excel Services enables developers to automate, customize, and interact with the Excel Web Access Web Part control on a page.

By using the ECMAScript object model, you can build mashups and other integrated solutions that interact with one or more Excel Web Access Web Part controls on a page. It also enables you to add more capabilities to your workbooks and to interact with them through code.

Page 17: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

2. Excel Web Services - Excel Web Services uses Simple Object Access Protocol (SOAP) over HTTP and acts as a communications interface between client programs and Excel Services. The Web service consists of methods and a set of complex type objects that you can use to access the complete functionality of Excel Web Services. To call the service, you must reference the Excel Web Services Web Services Description Language (WSDL).

Excel Web Services is expanded and enhanced in Microsoft SharePoint Server 2010. In SharePoint Server 2010, you can edit and save a workbook programmatically. In addition, the Excel Web Services now supports opening workbooks in edit sessions in SharePoint Server 2010. In this scenario, you can use code to edit a workbook at the same time that other users are co-authoring the workbook.

3. REST API - The REST API in Excel Services is new in Microsoft SharePoint Server 2010. By using the REST API, you can access workbook parts or elements directly through a URL.

Task 1 – Add an Excel Web Access Web Part

In this task, you will add an Excel Web Access web part to your site and connect it to an existing excel document. The web part will only display what has been published via Excel Web Services.

1. Navigate to the Lab05 home page, e.g., https://contoso.sharepoint.com/Lab05.

2. Create a new page called RevenueDetails to surface the excel workbook data.

a. Select Site Actions >> New Page

b. Name the page RevenueDetails

3. Select Page >> Edit

4. Select Insert >> Web Part

5. Select Business Data >> Excel Web Access and click Add.

Page 18: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

6. Select Click here to open the tool pane.

7. Select the ellipsis next to the Workbook textbox

8. Select Excel Workbooks/Ex2Before.xlsx and click OK.

9. Leave the reset of the settings as default and click OK at the bottom of the Tool Pane.

10. The web part should appear like it does in the following image.

Page 19: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Task 2 – Discover the REST API

In this task, you will use the self-discovery of the REST API to find the URL to the chart web part.

1. Navigate to the SharePoint Online REST API model page, e.g., https://contoso.sharepoint.com/Lab05/_vti_bin/ExcelRest.aspx/Excel%20Workbooks/Ex2Before.xlsx/model.

Note: Note the following important sections of the URL1. /_vti_bin/ExcelRest.aspx – This is the REST API base page

2. Excel%20Workbooks/Ex2Before.xlsx – This is the location of the excel workbook, relative to the web site

3. /Model – Indicates the root of the REST API.

2. You should see a page similar to the following image:

Page 20: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

3. Select Charts >> Chart 2.

4. Copy the URL from internet explorer to the clipboard, e.g., https://contoso.sharepoint.com/Lab05/_vti_bin/ExcelRest.aspx/Excel%20Workbooks/Ex2Before.xlsx/model/Charts('Chart%202')?$format=image).

5. Navigate back to the RevenueDetails Page, e.g., https://contoso.sharepoint.com/Lab05/SitePages/RevenueDetails.aspx.

6. Select Page >> Edit.

7. Select Insert >> Web Part.

Page 21: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

8. Select Media and Content >> Image Viewer >> Add.

9. From the webpart drop down, select Edit Web Part.

10. In the ImageLink textbox, paste the URL from the clipboard, e.g., https://contoso.sharepoint.com/Lab05/_vti_bin/ExcelRest.aspx/Excel%20Workbooks/Ex2Before.xlsx/model/Charts('Chart%202')?$format=image and click OK.

11. The image viewer web part will now display the chart information from your Excel workbook through the REST API.

12. Save and close the page to exit the editing session.

Page 22: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Task 3 – Test Your Solution

In this task, you will modify data within the excel application and see the changes reflected on the RevenueDetails page.

1. Navigate to the Excel Workbooks document library.

2. From the EX2Before document, select Edit in Microsoft Excel.

3. Change Canada’s revenue amount form $146,829.00 to $1,468,290.00.

4. Navigate to the RevenueDetails page, e.g., https://contoso.sharepoint.com/Lab05/SitePages/RevenueDetails.aspx.

5. Notice how the charts have updated to reflect the new revenue amounts.

Page 23: Excel Servicesaz12722.vo.msecnd.net/office365trainingcourse1-0/labs/... · Web viewIn this lab you will learn how to add Business Intelligence (BI) capabilities to your SharePoint

Summary

In this lab, we demonstrated some of the features of Excel Services in SharePoint Online. We added a Chart Web Part to a page and connected it to existing list data. Next, we leveraged an existing Excel document and published a portion of it to SharePoint Online with Excel Services. Lastly, we presented the data from the Excel spreadsheet in SharePoint Online through the REST API and the Excel Web Access web part.