Microsoft Office Tutorials and References
In Depth Information
• Output not as pixel-perfect as EWA: HTML output generated by REST and EWA are similar.
However, when CSS is used, the REST API can’t access all the classes as the EWA does.
• Tables: All cells are treated without any distinction when accessed through the Atom feed.
You can’t differentiate among table, cell, header, or general data.
• URL size: If there are many subfolders or parameters, the URL may not be set properly
because there’s a limitation of approximately 2,000 characters.
• Special characters: Characters such as ? or # are not supported.
Excel Services also supports the use of the Excel Services SOAP API. By using the SOAP API, you not only
can read the workbook content but also edit and save the workbook programmatically. In the next section, I will
demonstrate on how to use the Excel Services SOAP API with a simple example.
Excel Services OData API
Chapter 4 introduced the OData protocol and explored how SharePoint 2013 now allows connection to OData sources.
Excel Services 2013 introduces a new way to request data from Excel Services based on the OData protocol.
The OData API allows retrieval of data, inside tables, in an Excel workbook in the XML Atom format.
The URL syntax to explore workbook elements in the case of OData is the same as REST, with one
difference—that is, /Model should be replaced with /Odata as illustrated in the following request:
http://<yourServerName>/_vti_bin/excelrest.aspx/<Excel lib>/<Excel file>.xlsx/OData
Assuming you have a workbook ES_OData.xlsx with a table called Table1, the preceding URL returns following
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <collection href="Table1">
To access the top two rows of Table1, the following OData request URL can be used:
http://<yourServerName>/_vti_bin/excelrest.aspx/<Excel lib>/<Excel file>.xlsx/OData/ Table1?$top=2
The URL uses the system query option $top to specify the number of rows to return. Refer to the MSDN article at
msdn.microsoft.com/en-us/library/jj163211.aspx to find out about other OData system query options currently
supported by Excel Services.
in the current release of excel Services, you can only get data from tables in the workbook using OData.
Search JabSto ::