Getting started with PivotViewer control

Here is a basic walkthrough to get up and running with PivotViewer Control

After getting all the stuff as mentioned in the faq, Open VS2010 and create a silverlight application. Add a website hosted in IIS adding a clientAccesspolicy file as needed. Make sure it is set a startup project. Go the Property pages and select silverelightApplications and add a test page. set  the testpage as startup page. Make sure there are MimeTypes added in IIS for .cxml, .dzi and .dzc as “text/xml”

once you unzipped the tools,  you will find a docs folder in PAuthor folder. There is a sample.xlsx file. we will use that. The images are in the sample_images folder.

For simplicity, I copied everything in that folder to bin folder under PAuthor directory, If you are getting started, I would do the same, so we can get up and running without hiccups.

Go to command prompt to run the following command
Pauthor.exe /source excel sample.xlsx   /target deepzoom output\sample.cxml

one it is done in the “output” directory you will have “sample.cxml” and a folder “sample-deepzoom”. copy both of them to the website.

Now Add references to all the Pivot Assemblies from the folder “C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\PivotViewer\Jun10\Bin\”.  Not sure exactly which ones will be required as we are doing only minimal stuff.

open MainPage.xaml and add this namespace

Add the following XAML

 <Grid x:Name=”LayoutRoot” Background=”White”>
        <local:PivotViewer x:Name=”pv1″/>

go to codebehind of the MainPage, after the line with InitializeComponent();

add the following line to load the collection. In my case the website name is “Mysample”
pv1.LoadCollection(“http://localhost/Mysample/sample.cxml“, null);

Now if you run the sample, you should have everything working