3.2 End-user data connection
Including custom XML elements in Office documents presents companies with new opportunities for business process integration.
For example, an end-user can connect directly to enterprise systems and data sources using a Web services interface. The products do the heavy lifting: natively, in the case of InfoPath, and via VBA or an external extension, in the case of Word and Excel.
The data from the Web service can be cached by the product, which can then disconnect from the server. The user still maintains the ability to work with that data, even while disconnected. For this reason, Microsoft refers to Word, InfoPath, and Excel as smart clients.4 Once reconnected to the corporate server, the smart client can update the data sources.
The individual end-user also benefits from this ability to search for specific information and to aggregate information from multiple sources. It eliminates such time-consuming, error-prone tasks as:
opening and closing files to find information;
cutting and pasting information between documents; and
searching for labels to combine data in like fields.
Consider how a smart client can assist in the creation and processing of expense reports.
Prior to leaving on a trip, during which she won't have access to the corporate network, Ellen opens the Excel worksheet shown in Figure 3-6. Its cells are mapped to the element types of the expenseReport schema, as shown in the task pane.
Figure 3-6 Excel worksheet and task pane with XML source map
Each mapped element type corresponds to an area of the worksheet, either a single cell or a column of cells. The mapping allows XML data to be imported into, and exported from, the appropriate areas of the worksheet.
Ellen enters her employee number and the business purpose of her trip. The other cells that are visible in the example are populated automatically from the enterprise data store.
Her name comes from the human resources records, based on the employee number that she entered.
The lodging and airfare amounts come from the bookings made by the travel department.
The per diem is based on the location in the hotel booking.
The mileage is the calculated distance between the airport and Ellen's home address, also taken from the human resources records.
Ellen adds more items to the worksheet during the trip, even without the network connection. When she returns, she completes the report and exports the mapped cells as an XML document conforming to the expenseReport schema.5
3.2.2 Web pages
Ellen next wants to submit her report for management approval. It needs five levels of sign-off, so she decides to post it to an internal website where all the managers can read it.6
Figure 3-7 shows how FrontPage is used to design a Web page based on an XML document. Elements can be dragged from the expenseReport structure in the task pane onto the main page, and styles and other formatting options can be used to present the data.
Figure 3-7 FrontPage website view with data view details in task pane
Any XML document could be used as the data source, as could databases and Web services. Sorting, grouping, filtering, and conditional formatting of the data are supported.
FrontPage generates an XSLT stylesheet from the WYSIWYG display.7
After Ellen's expense report is approved, the XML document is sent to the accounting department's system, which deposits the reimbursement in her bank account.