29
Microsoft Excel: A Web Development Tool? Steve Hansen Grid Logic [email protected] OSP202

Microsoft Excel: A Web Development Tool? Steve Hansen Grid Logic [email protected] OSP202

Embed Size (px)

Citation preview

Microsoft Excel: A Web Development Tool?Steve HansenGrid [email protected]

OSP202

My Creds

MVP for Visual Studio Tools for Office since 2006Author of two books on ExcelSeveral Office development related whitepapers, videos, and articles on MSDNGraduate of Rollins College (oldest recognized college in FL)

Objectives

Provide an overview of SkyDrive and ExcelUnderstand how to leverage Excel on other websitesBecome familiar with the basics of the Excel Services JSOM

SkyDrive & Excel Overview

Does Excel really need an introduction?

Three primary usage patternsAnalyze dataManage dataVisualize data

Hundreds of other uses

1987 1989 1991 1993 1995 1997 1999 2001 2003 2005 2007 2009 2011 2013

Excel 2.0

Excel 3.0

Excel 4.0

Excel 5.0

Excel 95

Excel 97

Excel 2000

Excel 2003

Excel 2002

Excel 2007

Excel2010

Excel Beyond the Desktop

Excel Services Real-time, interactive, Excel-based reporting and dashboard capabilities. Includes APIsIntroduced with SharePoint Server 2007

Excel Web AppsCreate, view, edit workbooks using a browserIntroduced with Office 2010

Excel Programmability Options

VBA since Excel 5 (1993)VSTO since Excel 2003Excel Services JSOM since Excel 2007So what does this have to do with SkyDrive?

Older school…Old school…Not so old school…

SkyDrive Summarized

File hosting serviceAccess files across devicesSimple sharing with anyoneView, create, and edit files with FREE Office Web AppsSo what does this have to do with Excel?

SkyDrive – your files whenever and wherever you need them.

Excel on SkyDrive

SkyDrive includes:Office Web AppsCapabilities of the JSOM API for Excel

SkyDrive provides:Ability to embed a workbook object on any web pageAbility to use the JSOM API for Excel from any external web page

demo

Steve HansenArchitectGrid Logic

SkyDrive and Excel

Embedding Excel

Embedding Excel on a Web Page

What do you need?SkyDrive account (free) – sign up at live.com

High-level StepsCreate the workbook. Go ahead – be creative.Save to SkyDriveSet permissions – the workbook must be “public”Embed the workbook on a web page using iframe or JavaScript

Two ways to embed Workbook

Embed using an iframeUse for showing the spreadsheet on a web pageCannot be manipulated programmatically

Embed using JavaScript and a div elementUse for showing the spreadsheet on a web pageCan be manipulated programmatically

Either method can be initiated from SkyDriveSelect the workbook on SkyDriveChoose EmbedIf the file is already open in the Excel Web App, ShareEmbed on Home tab

Tailor the look

Choose what to display

Choose method

Set dimensions

Specify interactivity

Toggle grid lines and column/row headers

Preview

demo

Steve HansenArchitectGrid Logic

Embedded Excel Workbooks

Excel’s JavaScript Object Model

Overview of the JavaScript Object Model

AsyncResult

EwaControl

NamedItem

Range RangeEventArgs

NamedItemCollection

EwaControlCollection

Sheet

SheetCollection

WorkbookWorkbookEventArgs

Capabilities of the JSOM

Get/set values of rangesActivate sheetsCalculate the workbookRefresh data connectionsEvents:

Active cell changedSelection changedEntered cell editingWorkbook changedGrid synchronized

Treat Excel workbooks as programmable objects

Source Excel workbook

Embedded on web page

JSOM Initialization

First step is to initialize the EWA controlKey differences for SkyDrive vs. SharePoint

On SharePoint, the typical pattern is to place EWA web part on same page, and then merely obtain a referenceFor SkyDrive, you use a method that embeds Excel on the pageSkyDrive uses a file token to specify which workbook to loadThink of the file token as a SkyDrive specific URLUse the method EwaControl.loadEwaAsync:var ewa = Ewa.EwaControl.loadEwaAsync(

fileID, divID, embedOptions, callback, userContext);

Using the JSOM - Initialization var ewa = null; var fileToken = "<your token>"; if (window.attachEvent) { window.attachEvent("onload", loadEwaOnPageLoad); } else { window.addEventListener("DOMContentLoaded", loadEwaOnPageLoad, false); }

function loadEwaOnPageLoad() { var props = { item: "Chart 1", uiOptions: {<omitted for brevity>}, interactivityOptions: {<omitted for brevity>} }; Ewa.EwaControl.loadEwaAsync(fileToken, "chartDiv", props, onEwaLoaded); }

function onEwaLoaded(result) { if (result.getSucceeded()) ewa = result.getEwaControl(); }

demo

Steve HansenArchitectGrid Logic

Using the JSOM on SkyDrive-hosted Workbooks

Summary

Excel has moved beyond the desktop

SkyDrive includes the Excel Web App

SkyDrive delivers the power of Excel Services to the masses

It is easy to embed Excel in external web pages

The JSOM API enables developers to treat Excel as a programmable object

Related Content

Breakout Sessions (session codes and titles)

Hands-on Labs: OPS54-HOL - Creating and Publishing an XL Workbook to SP

Product Demo Stations: Office 365 S. Hall A

Find Me At the Office 365 Demo Station: Wed. 12:30-3:30

Related Resources

Office 365 TechCenter: technet.microsoft.com/Office365

Office Client TechCenter: technet.microsoft.com/officeOffice, Office 365 and SharePoint Demo Area Includes:

Office 365 IT Pro Command CenterOffice 365 Data Center Exhibit

Resources

Connect. Share. Discuss.

http://northamerica.msteched.com

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Resources for Developers

http://microsoft.com/msdn

Complete an evaluation on CommNet and enter to win!

MS Tag

Scan the Tagto evaluate thissession now onmyTechEd Mobile

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

PRESENTATION.