Import Expression Blend sample data from Excel in three easy steps

My company builds data acquisition and management applications for large industrial systems. When I design a view for this kind of usage I need great quantities of sample data adhering to certain rules (e.g. the aggregated consumption of device can only increase over time). 
The tool to create this kind of sample data efficiently is Excel:

image

How to import Excel data to Blend?

Blend supports importing sample data from xml. Now we just have to find a way to export our worksheet as an xml file.

I’m no Excel ace and simply saving the worksheet as xml produces an ugly structure. I’m sure there are ways to make it better, but since I’m prototyping I need a quick solution.

Mr. Data Converter to the rescue

Thanks to Shan Carter’s genius we have a simple copy-paste way to do this. Simply visit his Mr. Data Converter website and paste the data from Excel to the left text box. Then on the right set the output format to XML and push Convert.

image

Copy the results to a text editor and save it as an xml file.

Importing xml as sample data to Blend

In Expression Blend select the Data tab. Click the “Create sample data” button and select “Import Sample Data from XML…” from the dropdown menu:

image

From here on it’s quite straightforward. You select the xml file and add a name for the new sample data source.

image

There we have it! A big number of no nonsense sample values in a nicely structured collection. It only took two minutes thanks to Mr. Data Converter.

UPDATE:
You can tweak the data types in the generated xml schema (xsd) if you need to. For example if a value is not a decimal type, it will not be shown on a chart’s linear axis.

image

UPDATE 2:
Nope! You also have to edit the cs of the sample data. Things are getting fugly..

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2012 Szili | powered by WordPress with Barecity