Ewa.EwaControl Object
Applies to: apps for SharePoint | SharePoint Server 2010
Represents the Excel Services Web Part on the page.
Ewa.EwaControl
Remarks
The Ewa.EwaControl object represents an Excel Services Web Part. In the Excel Services API, all other objects in the API are accessed through the Ewa.EwaControl object.
For more information about the Excel Services Web Part, see Excel Web Access in the SharePoint Server 2010 SDK documentation.
Example
The following code example shows how to get a reference to an Excel Services Web Part.
<script type="text/javascript">
var ewa = null;
// Add event handler for onload event.
if (window.attachEvent)
{
window.attachEvent("onload", ewaOmPageLoad);
}
else
{
window.addEventListener("DOMContentLoaded", ewaOmPageLoad, false);
}
// Add event handler for applicationReady event.
function ewaOnPageLoad()
{
if (typeof (Ewa) != "undefined")
{
Ewa.EwaControl.add_applicationReady(ewaApplicationReady);
}
else
{
alert("Error - the EWA is not loaded.");
}
// Add your code here.
}
function ewaApplicationReady()
{
// Get a reference to the Excel Services Web Part.
ewa = Ewa.EwaControl.getInstances().getItem(0);
// Add your code here.
}
// Add your code here.
</script>