Microsoft Office Tutorials and References
In Depth Information
EWA and API Working Together
The web page you created loads the workbook in the EWA and the Page Viewer renders the custom
code. Figure 14-2 shows what the page looks like when the custom code is executed.
Note the following:
GetAPIVersion button — Clicking this button makes an Excel Services web service GetApiVersion
method call. The returned version information is displayed in the adjacent text box.
Get EWA Session ID button — Clicking this button makes a call to the EWA EwaGetSessionId
function, which returns the sessionId of the currently loaded workbook.
Get Workbook button — Clicking this button makes an Excel Services web service GetWorkbook
method call using the two adjacent controls as arguments. The drop-down control is used to select
the WorkbookType , and the Workbook Name field is used to provide the name of the workbook to
be saved. The sample code currently has a hard-coded target folder for these workbooks that you
need to update to work in your environment.
Reload EWA Workbook button — Clicking this button makes a call to the EWA EwaReloadWorkbook
function, which returns a TRUE or FALSE status to reflect whether or not the EWA reload call was
successful. The function reloads the original workbook, so any private state that previously existed
Get Selected EWA Cell button — Clicking this button makes a call to the EWA
getHighlightedCellA1Reference function, which returns the currently selected cell in the EWA grid. The string
is returned in the format ‘ Sheet1 ’ !C15 . When no cell is selected, null is returned.