Search code examples
c#silverlightpivotviewer

My PivotViewer isn't displaying any information


I'm trying to learn how to use the PivotViewer control for Silverlight. I used the excel tool to create a collection and I output the files to a folder called 'asdf'. Then I copied this folder with all of it's contents to the D: partition and here is the code I use to call the collection:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace PivotTest
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            Pivot.LoadCollection(@"D:\asdf\my.cxml", string.Empty);            
        }
    }
}

Here's a screenshot of what's inside the folder and what I get in the browser when running the application. alt text

alt text

Any suggestions on what I'm doing wrong? Thanks for the help!


Solution

  • My guess is that the PivotViewer is not allowed to access the xml file on your local drive. You have to put the xml file on your web server (i.e. localhost:64413) and access it through http.