ReportViewerWithC1Report
------------------------------------------------------------------------------------
Shows how you can use the C1ReportViewer for Silverlight to display reports created with C1Report.

The server part of the sample implements a simple Silverlight-enabled service with
two methods:

GetReportList() returns an array containing the names of the reports available.

GetReport(string reportName) returns a byte array with the report content rendered as a PDF 
stream.

Both methods use the C1Report class to load report definitions from a report definition 
file called "CommonTasks.xml". This file is deployed with the server part of the application
and contains several report definitions.

The report definition file specifies where the data should be loaded from and how it should 
be formatted to create the reports. You can create and edit the report definition files
using the C1ReportDesigner application that ships with the ComponentOne Studio products.
You can also use the C1ReportDesigner to import report definitions from Microsoft Access 
and from Crystal reports.

The client part of the application is even simpler:

When the application starts, it calls the GetReportList method to populate a combo box with
the list of reports available on the server. The code looks like this:

<code>
        public MainPage()
        {
            InitializeComponent();

            // populate combo with report list
            var svc = new C1ReportServiceReference.C1ReportServiceClient();
            svc.GetReportListAsync();
            svc.GetReportListCompleted += (s, e) =>
                {
                    _cmbReports.ItemsSource = e.Result;
                };
        }
</code>

When users pick a report from the combo, the app calls the GetReport method to retrieve an
array of bytes that represent a PDF stream containing the report. This stream is then loaded
into the C1ReportViewer control using the LoadDocument method.

The code looks like this:

<code>
        void _cmbReports_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // get report as PDF stream
            var svc = new C1ReportServiceReference.C1ReportServiceClient();
            svc.GetReportAsync((string)_cmbReports.SelectedValue);
            svc.GetReportCompleted += (s, re) =>
                {
                    // pass PDF stream to the viewer
                    var ms = new System.IO.MemoryStream(re.Result);
                    _c1rv.LoadDocument(ms);
                };
        }
</code>

Note that:

1) The report definition file "CommonTasks.xml" is deployed with the server part of the
application. It is not hardwired or embedded in the application, and can be changed 
easily without touching the app at all.

2) All the reports loaded by the application use the same data source: the nwind.mdb
file that is installed with the ComponentOne Studio for WPF. The location of the
mdb file is <YOUR_PERSONAL_FOLDER>/ComponentOne Samples/Common.

3) The server part of the application has a licenses.licx file that contains licensing
information for the C1Report component. This file was added manually (if the server side
of the application had windows of forms, we would have added the C1Report component to
a window or form and Visual Studio would have created the licenses.licx file automatically
for us.

4) In order to run this sample successfully, you need install Studio for WPF.
