Showing posts with label Excel Service. Show all posts
Showing posts with label Excel Service. Show all posts

Wednesday, October 27, 2010

ExcelService - RangeCoordinate

small discription about range coordinat, cause I was pretty confused while using it, so sharing my exp
RangeCoordinates rngCrd = new RangeCoordinates();


rngCrd.Row = 0;


rngCrd.Column = 0;

rngCrd.Height = 3;

rngCrd.Width = 10;
 
.Row = start Row
.Column = start column
.Height = no of rows. in this case total three rows.
.Width = no of columns, total ten columns.
 
So the above line mean, range starting from 0th row,0th column and ending at 10th column of 3rd row.
 
Happy coding

Monday, December 21, 2009

Add Excel Web Renderer Webpart From SilverLight ObjectModel

Hi,
First in How To's :)
To add a Excel Webpart from Silverlight oject Model -





ClientContext cnt = new Microsoft.SharePoint.Client.ClientContext("http://hydhtc130180d:3333/");
if (cnt == null)
{
throw new Exception("connection failed");
}
else
{
string ewaWebpart = "<?xml version='1.0' encoding='utf-8'?><webParts><webPart xmlns='http://schemas.microsoft.com/WebPart/v3'><metaData>";
ewaWebpart +="<type name='Microsoft.Office.Excel.WebUI.ExcelWebRenderer, Microsoft.Office.Excel.WebUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' />";
ewaWebpart +="<importErrorMessage>Cannot import this Web Part.</importErrorMessage>";
ewaWebpart +="</metaData>";
ewaWebpart +="<data>";
ewaWebpart += "<properties>";
ewaWebpart += "<property name='Title' type='string'>ExcelWebRenderer</property>";
ewaWebpart += "</properties>";
ewaWebpart +="</data></webPart></webParts>";
LimitedWebPartManager limitedWebPart = cnt.Web.GetFileByServerRelativeUrl("/SitePages/mypage.aspx").GetLimitedWebPartManager(PersonalizationScope.Shared);

WebPartDefinition ewaWebPartDef = limitedWebPart.ImportWebPart(ewaWebpart);
limitedWebPart.AddWebPart(ewaWebPartDef.WebPart,"Left",1);


cnt.ExecuteQueryAsync(s1, f1);

Wednesday, September 16, 2009

Excel Services and soap

Excel Services and Soap call.

javascript enabled web services can be used to get client side activites in Excel services.
Below is the code snippet for getRangeA1 -

request = new ActiveXObject("Microsoft.XMLHTTP");
var url = "http://localhost/_vti_bin/excelservice.asmx";
var envelope = "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<soap:Body>"+
"<getcella1 "+
"xmlns=\'http://schemas.microsoft.com/office/excel/server/webservices\'>"+
"<sessionid>"+ EwaGetSessionId('WebPartWPQ3') +"</sessionId>"+
"<sheetname>"+"Sheet1" +"</sheetName>"+
"<rangename>"+"B3"+"</rangeName>"+
"</GetCellA1></soap:Body></soap:Envelope>";

alert(envelope);
request.open("Post",url,false);
request.setRequestHeader("Content-Type","text/xml");
request.send(envelope);
alert(request.statusText);