Microsoft Office Tutorials and References
In Depth Information
EWA and API Working Together
Configuring the Context Editor Web Part
Follow these steps to configure the Context Editor Web Part:
1. Webservice.htc must be in the same directory as the testPage1.aspx file, because it is used as
part of the solution to make Excel Services web service calls. Obtain Webservice.htc from
http://msdn.microsoft.com .
2. Click the edit link on the Context Editor Web Part and click Modify Shared Web Part. Click the
Source Editor button to open a Text Entry window where you can enter HTML and <script>.
3. Enter the following code into the Source Editor. Search for ‘WebPartWPQ4’ and replace
the string with the EWA Web Part ID that you noted in a previous procedure. Search for
theexcelserver:38712 and replace the string with your server information.
<SCRIPT LANGUAGE=”JavaScript”>
<! —
var iSessID;
function callSvc()
{
service.useService(
“http://theexcelserver:38712/_vti_bin/ExcelService.asmx?WSDL”,
“EcsWs”);
}
function callGetSessionInfo()
{
callSvc();
var sessionId = document.getElementById(‘_sessionId_xl’).value;
iSessID = service.EcsWs.callService(“GetSessionInformation”, sessionId);
}
function onWSGetResult()
{
// Error was returned
if((event.result.error)&&(iSessID==event.result.id))
{
// Get the error details
var errCode = event.result.errorDetail.code;
var errString = event.result.errorDetail.string;
var errSoap = event.result.errorDetail.raw;
// Add code to handle specific error codes here
if(iSessID==event.result.id)
{
document.getElementById(‘_sessionInfo_xl’).value = “ERROR”;
}
}
// No error
else if((!event.result.error)&&(iSessID==event.result.id))
Search JabSto ::




Custom Search