In this first exercise, you’re going to integrate
Marketplace DataMarket data (specifically the DATA.gov crime statistics
data feed) with Excel 2010 by using the Marketplace DataMarket add-in
for Excel that you just downloaded. After you integrate some crime data
into Excel, you will create a PivotChart and PivotTable, and then
publish the Excel document to SharePoint. Finally, you’ll use Excel
Services to publish select portions of the Excel document to SharePoint
using Excel Web Access Web Parts.
You will begin by consuming the DataMarket data in Excel 2010.
Consume Windows Azure Data in Excel 2010
1. Consume Windows Azure Data in Excel 2010
Open Excel 2010, and click the Data tab on the Excel 2010 ribbon. Click the Import Data From Windows Azure Marketplace DataMarket button. This opens the Marketplace DataMarket custom task pane. In
the custom task pane, add your account key, and then click Sign In. The
data feeds you added to your Marketplace DataMarket subscriptions will
appear in the custom task pane.
Find the DATA.gov feed listed in the custom task pane, and then click Import Data. In the Query Builder dialog box, click Add Filter, and select State. Then type Washington in the filter field. This filter returns the same data you saw earlier when you explored the data via your web browser.
Click Import Data to import the data from Windows Azure Marketplace DataMarket into your Excel 2010 document. The result of this import should look similar to the following image.
The data is imported as a table object, so you can filter, sort, hide, and show columns, and create charts, PivotTables, and so on, to create an analysis of the data. More than likely, you’ll want to create a filtered analysis of DataMarket data within Excel,
and this is where you have some great capabilities at your fingertips.
For example, you can use the formatting, charting, or PivotTable and
PivotChart capabilities built into Excel
to create compelling analyses. Explore the different features of Excel
after you’ve imported the data to gain an understanding of the types of
analyses you can build. For now, continue this exercise to create a
PivotChart and PivotTable.
Note:
More Info You can find more information on how to use Excel 2010 at http://office.microsoft.com/en-us/excel-help/what-s-new-in-excel-2010-HA010369709.aspx.
Click
the Insert tab, click the PivotTable arrow (not the button), and then
select PivotChart. Select the default table range and location, and then
click OK. In the Field List, select a set of options such as State, City, ViolentCrime, Burglary,
and so on. Excel automatically generates a PivotTable and a PivotChart
for you, as shown in the following image. You’ll want to filter the
options down to a point where the data in the chart becomes legible.
After you’ve finished creating the PivotChart, save the file to a local directory.
You’ve now completed the
first exercise. However, the document you just created is one that only
you have access to on your local computer. To expose this type of
information to others in your organization, you’ll often want to publish
documents or elements of documents such as this to SharePoint. By
publishing, you can share the entire document or build dashboards out
of, for example, the charts or tables that are generated automatically
during the PivotChart and PivotTable creation process.
Next, you’ll walk through the process to expose elements of the document to SharePoint by using Excel Services.
2. Publish Excel Objects to Excel Services
Open your SharePoint site, and navigate to a document library. Click the Documents tab, click Upload Document, and then click Upload Document. Click
Browse in the Upload Document dialog box, and then select the Excel
document you created in the previous exercise and saved to your local
drive. Click the Options menu beside the document, and select Edit In Microsoft Excel.
Click File, select Save & Send, and then click Save To SharePoint. Click Publish Options, which is located in the upper-right corner of the Backstage view. In the Publish Options dialog box, select Items In The Workbook in the drop-down list. Select all the items.
Click OK, and save the Excel document back to your SharePoint site by clicking Save. Lastly,
right-click the link to the Excel document in the document library, and
select Copy Shortcut. Paste the link somewhere convenient (for example,
in a Notepad file) .
At this point, you’ve
saved the Excel document that contains Marketplace DataMarket data to
SharePoint and have published the objects that make up the document to
SharePoint by using Excel Services; that is, the chart and table objects. With Excel Services, you can expose worksheets, charts, named ranges, and other objects in an Excel document.
Note:
To get a more controlled view
of your data, you can copy and paste data (just the values) from the
table into a new worksheet, create a separate named range, and then
style that table as you like. That involves some manual work—but you’ll
end up with a new named range that exposes the exact data you want to
create within a cleanly formatted named range.
3. Surface Windows Azure Marketplace DataMarket Data by Using SharePoint Excel Services
Navigate to your SharePoint site, and click Site Actions | View All Site Content. Click Create, select Web Part Page, click Create, and provide a name for your page (for example, Crime Data). Leave the default location in Site Assets. After you’ve created the Crime Data page, navigate to it and click Site Actions, and then Edit Page. Click Add A Web Part, and select Business Data. Within the Business Data category, select Excel Web Access, and click Add. After the Web Part has been added to the page, click the Click Here To Open The Tool Pane option. In
the Workbook field, enter the shortcut you copied to Notepad (or your
Clipboard) in the previous exercise, which points to the Excel
document that you uploaded into your SharePoint site. (If you didn’t
copy and paste the link, navigate to the document library where you
uploaded the Excel document, right-click the document, and select Copy
Shortcut.) In
the Named Item field, add the item you want to expose—these are the
items you published using Excel Services and the Publish Options dialog
box. The following image illustrates the link and PivotTable1
object configured in the Excel Web Access Web Part. (Note that you may
need to configure the height and width of the Web Part. You can do this
by expanding the Appearance section in the Options pane and entering a
custom height and width.)
When done, click OK. SharePoint now exposes filtered and sorted data by using Excel Services, as shown in the following image.
You can also create other Excel Web Access Web Parts and expose different parts of the Excel
document to create a Crime dashboard. It is noteworthy that you can
also go beyond just using the Excel Web Access Web Part and use the Excel Services REST URI to expose elements in the Excel document to SharePoint. For example, the following REST URI exposes the chart that was automatically created in the PivotChart process (Chart 1) in the web browser: http://blueyonderdemo/_vti_bin/ExcelRest.aspx/newprops/Crime/Contoso_Store_Crime_Supplement.xlsx/Model/Charts(‘Chart%201’) You
can use this same REST URI to expose this image in an Image Viewer Web
Part. To do this, simply navigate to your SharePoint site, click Site
Actions | Edit Page, and then insert a new Image Viewer Web Part. Click
the Open The Tool Pane link in the newly added Web Part and paste the Excel Services REST URI into the Image Link field. What results is something similar to Figure 2-5,
which you can use in your dashboards. This reference then uses the
Excel document (within which the chart object lives) as the common point
of reference; every time you update the chart, the image in the Web
Part also updates without any intervention on your part. Thus
far, you’ve seen how to integrate Marketplace DataMarket data to
SharePoint without using any code. This type of integration is great for
quickly building dashboards and reports that you can expose in
SharePoint by using the different features of Excel Services.
|