You can use OfficeControl to add an Office document to a view. OfficeControl is provided as an ActiveX control, so that it can be displayed in browsers that support ActiveX controls.
For browsers that do not support ActiveX controls, the following runtime exception is raised: Office Integration through Applet is not supported.
The ActiveX control element enables the following documents to be displayed:
○ Microsoft Word documents with the file extension doc
If on client side Office 2007 is installed, the extensions docx and docm are also supported.
○ Microsoft Excel documents with the file extension xls
If on client side Office 2007 is installed, the extensions xlsx and xlsm are also supported.
Make sure that all clients have an installation of Office 2007, before you use the extensions docx, docm, xlsx and xlsm.
You can only use the OfficeControl UI element if one of the following software programs is installed:
● Microsoft Office XP, Office 2003, Office 2007
If you have Microsoft Internet Explorer installed, check your Internet Options to see whether the ActiveX control elements for executing and initializing are enabled. To do this, choose Internet Options → Security → Custom level → ActiveX controls and plug-ins → Enable. Otherwise, the Office document cannot be displayed.
● activateInPlace
Controls whether the document appears in the browser window, or the system opens the Office application linked to the document type in a separate window. If you have assigned the value false to the activateInPlace property and the value ms_word to the documentType property, Microsoft Word opens and displays the content in the Microsoft Word user interface.
If you have assigned the value false to this property, you should then make sure that you assign small values to
the height and width properties, because these values are not ignored and act as placeholders in
the view of the Web Dynpro application. In the view, the UI element takes up
as much empty space as you have specified for the height and width properties. You should therefore overwrite the default value of 300 with a
smaller one, such as 5.
If you have assigned the value true to this property, you should use suitable values for displaying the document. This will ensure that the document is readable and that the user does not have to scroll too often, as it is not possible to increase the size of the document in the browser window at runtime.
● controlId
At present, this property does not affect the appearance of the document.
● dataSource
You use this property to specify the data source. You can use it to specify the path to the context attribute that provides the data. The context attribute must be of Resource type.
● documentName
You can use this property to describe the name of the document.
● documentType
You can use this property to describe the document type that you want to display. Property documentType can take the following values and is represented by enumeration type WDOfficeDocumentType:
ms_word |
Microsoft Word document with the file extension doc. |
ms_excel |
Microsoft Excel document with the file extension xls. |
● enableReadWrite
At present, this property does not affect the appearance of the document.
● expertMode
Specifies how access to the document is handled. falsespecifies that opening and closing is triggered by property visible. true specifies that access to the document can be triggered using various methods that you can access using IWDIOSFactory.
● height
Specifies the height of the UI element that you can specify in CSS sizes, such as em, ex or pixels.
● width
Specifies the width of the UI element that you can specify in CSS sizes, such as em, ex, pixels or percentage values.
● showDecoration
At present, this property does not affect the appearance of the document.
Name |
Interface |
Type |
Initial Value |
Bindable |
activateInPlace |
IWDOfficeControl |
boolean |
true |
bindable |
controlId |
IWDOfficeControl |
String |
|
not_bindable |
dataSource |
IWDOfficeControl |
Object |
|
bindable_mandatory |
documentName |
IWDOfficeControl |
String |
|
bindable |
documentType |
IWDOfficeControl |
WDOfficeDocumentType |
ms_word |
bindable |
enableReadWrite |
IWDOfficeControl |
boolean |
true |
bindable |
enabled |
IWDUIElement |
boolean |
true |
bindable |
expertMode |
IWDOfficeControl |
boolean |
false |
bindable |
height |
IWDAbstractActiveComponent |
String |
300px |
bindable |
showDecoration |
IWDOfficeControl |
boolean |
true |
bindable |
tooltip |
IWDUIElement |
String |
|
bindable |
visible |
IWDUIElement |
WDVisibility |
visible |
bindable |
width |
IWDAbstractActiveComponent |
String |
300px |
bindable |
● onClose
This event is triggered if the document is closed. This is the case if the document is displayed in a separate window, and the user closes the document using either Alt + F4 or the Close icon on the Office application toolbar. The onClose event is also triggered if the Web Dynpro application calls the close method of the IWDIOSDocument that you can call using IWDIOSFactory.
● onSave
This event is
triggered if the document is saved. This is the case if the user chooses
either
Ctrl +
S or the Save icon on the Office Application toolbar.
The onSave event is also triggered if the Web Dynpro
application calls the save method of the IWDIOSDocument that you can call using IWDIOSFactory.