You can create data sources to expose data in Microsoft Excel 97-2007 as services using the WSO2 Data Services Server. For demonstration, we use an excel sheet containing three columns, namely, ID, Model and Classification. The sheet is then filled with mock data. Note that the column names should appear in separate cells. For example,
To Excel datasources allow you to create a data source with Excel, follow the steps in Creating Data Sources. When you select EXCEL as the data source type at the time a data source is created, service using an Excel spreadsheet as the data storage type.
You can get the Add New Datasource screen shown below on the management console by executing steps 1 to 3 in creating a data service. Then, select EXCEL as the Datasource Type. It opens the Excel-specific options appear. For example: as shown below:
The Use Query Mode option (in the UI above) allows you to create Excel data sources in two different ways as follows:
...
Also, see a demonstration of service enabling an Excel sheets in Excel Sample.
Excel
...
data sources in
...
non-
...
query mode
Anchor | ||||
---|---|---|---|---|
|
To create a data source in non-query mode, simply uncheck the Use Query Mode check box and save. Then, click Next to add a query. Note that the Query Details UI does not provide support to write a query. You can simply add Output Mappings to define how the output looks like. For example,
Excel
...
data sources in query mode Anchor Q Q
Q | |
Q |
To create a data source in query mode, check the Use Query Mode check box and save. Then, click Next to add a query. Note that the Query Details UI now provides support to write a query. For example,
...
Code Block |
---|
DROP SHEET ProductCategories |
To write a query to this data source, see Writing Data Service Queries.
Also, see a demonstration of service enabling an Excel sheet in Excel Sample.