2013年9月24日星期二

SharePoint 2013 Excel Services REST API presentation

 

Preface : Excel Services REST API in Microsoft SharePoint Server 2010 is a new addition. Use REST API, can be accessed directly via a URL workbook parts or elements.

 

one , REST service is based on two requirements :

 

used to locate network resources addressing scheme

 

used to return representations of these resources in the form of method

 

two , REST URL basic URI three components is :

 

REST aspx page URI: http:// / _vti_bin / ExcelRest.aspx

 

workbook location :/ Docs / Documents / sampleWorkbook.xlsx

 

resource location :/ model / Ranges ('nameOfTheNamedRange')

 

three , API simple applications and examples :

 

1, the cells show :

 

Example : http://URL/_vti_bin/ExcelRest.aspx/DocLib1/ExcelTest.xlsx/model/Ranges ('A1')

 

 

Attachment: Complete Excel

 

 

2, the chart shows

 

case : Special Instructions "% E5% 9B% BE% E8% A1% A8% 201 " == < strong> " chart 1 " means that after Url encode

 

http://URL/_vti_bin/ExcelRest.aspx/DocLib1/ExcelTest.xlsx/Model/Charts ('% E5% 9B% BE% E8% A1% A8% 201')

 

 

Attachment: The original Excel screencast

 

 

3, showing the range of cells (Excel above chart, range selection does not show the chart )

 

Example : http://URL/_vti_bin/ExcelRest. aspx/DocLib1/ExcelTest.xlsx/Model/Ranges ('A1 | M5')

 

Special : Sheet2! A1% 7CM5, marked underlined , you can select the worksheet , half-width exclamation separated ;

 

 

4, showing the range of cells and set a cell's value

 

Example: ( original Excel Excel as shown above ) http://URL/_vti_bin/ExcelRest.aspx/DocLib1/ExcelTest.xlsx/Model/Ranges ('Sheet2! A1% 7CN5')? Ranges ('Sheet2! N2 ') = 88 & Ranges (' Sheet2! N3 ') = 98

 

 

four returns atom 's XML < strong> format

 

by returning an XML file, we can carry out the next step in the code Coding, can be based on an Excel document published statistics , display and so on.

 

cases : ($ format = atom parameters )

 

http://URL/_vti_bin/ExcelRest.aspx/DocLib1/ExcelTest.xlsx/Model/Ranges ('Sheet2! A1% 7CN5')? Ranges ('Sheet2! N2') = 88 & Ranges ('Sheet2! N3 ') = 98 & $ format = atom

 

 

Right View Source :

 

 

Special : As a complete XML code share too much space , so the only interception of the current screen , please forgive me !

 

five , Excel Services REST API in unsupported features

 

following Excel Services REST API currently does not support the use of a number of important functions or a partial list :

 

· no floating figure . If a range contains chart and you REST requests through this range , only for the ranges.

 

· no mini- map, no icon conditional formatting . currently not supported.

 

· no pixels ( ideal EWA ). REST generated HTML and Excel Web Access generated HTML is very similar. But Excel Services REST API can not access Excel Web Access can access all the cascading style sheet (CSS) elements. Excel Services REST API returns an HTML fragment . This HTML fragment must be self -contained.

 

· table, there is no difference . When the form of the Atom request form to view the cell is a column header or data , total or conventional data, the table will not produce any difference . In other words , there is no specified cell or data is the title , total or conventional data differences. The equal treatment of all tables in a table cell.

 

· URL size limit. URL size will be limited to approximately 2000 characters. This means that if the workbook has a number of parameters , you may not be able to set all the parameters. Especially in the workbook is located in a lower position the folder structure when this happens .

 

· special characters. does not support , such as " ? " and "# " such characters. To properly referenced worksheet contains a special character names , to the special character of the worksheet with reference formulas , the basic principle is " to understand what actions Excel Client ," and follow the appropriate examples.

 

Conclusion :

 

the sdk herein by reference MSDN documentation , do a simple example , if in doubt please refer to the attached references ; For Excel Services REST API to understand a bit, overthrew the previously considered Excel Services Web display only the impression , in fact, this function can also be based on simple develop some new applications.

 

References :

 

Excel Services REST API Overview

 

http://msdn.microsoft.com/zh-cn/library/ee556842 (v = office.14). aspx

 

Excel Services REST API resource URI

 

http://msdn.microsoft.com/zh-cn/library/ff394530 (v = office.14). aspx

没有评论:

发表评论