Microsoft Office Tutorials and References
In Depth Information
EWA and API Working Together
Property Name
Type
User Interface Equivalent
Default
Value
Display Periodic Data Refresh
prompt
AutomaticPeriodicDataRefresh
enum
Automatic
PeriodicDataRefreshMode
Always
CloseWorkbookSessions
bool
Close Session Before Opening A
New One
false
Type of toolbar
ToolbarStyle
enum
Toolbar
VisibilityStyle
Full
You can obtain a complete listing of the EWA Web Part properties by exporting the Web Part from a
SharePoint page. Follow these steps to see all of the properties:
1.
Navigate to a SharePoint page that contains an EWA Web Part, or add one to an existing page.
2.
Open the EWA Web Part menu and click Export.
3.
Save the .webpart file to disk and then open the file using Notepad. The available EWA Web
Part properties are displayed in the file.
The AutomaticPeriodicDataRefresh and ToolbarStyle properties expect an enum value, as follows:
AutomaticPeriodicDataRefresh — Has three supported values: Disabled , Optional ,
and Enabled . The user interface choices are Always , Optionally , and Never .
ToolbarStyle — Has four supported values: FullToolbar, SummaryToolbar,
NavigationOnlyToolbar, and None. The user interface choices are Full, Summary,
Navigation Only, and None.
Add the following code to the previous xlEwa.aspx sample solution to try out the
AutomaticPeriodicDataRefresh and the ToolbarStyle EWA properties. With these settings, if you use
periodic data refresh, the data refresh happens automatically without prompting the user. Also,
the EWA toolbar functionality is reduced to navigation operations only.
m_excelWebRenderer.AutomaticPeriodicDataRefresh =
AutomaticPeriodicDataRefreshMode.Enabled;
m_excelWebRenderer.ToolbarStyle = ToolbarVisibilityStyle.NavigationOnlyToolbar;
EWA and API Working Together
This section describes two approaches for using custom code to interact with an EWA session when
the EWA Web Part is embedded as part of a SharePoint page. The first approach leverages the Content
Editor Web Part, JavaScript, and Excel web services. The second approach is a bit more advanced, and
makes use of a custom web application and managed code, the Page Viewer Web Part, and Excel web
services. Each approach demonstrates how the Excel API can interact with an active EWA session.
Search JabSto ::




Custom Search