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;
using Telerik.ReportViewer.Silverlight;
using Telerik.Reporting.Service.SilverlightClient;
using System.ServiceModel;

namespace Example
{
    // what we want is to send parameter to the Report1.cs class at client side. Please write a code sample that provides us the information we need to do this. Briefly we want to send parameter from this page to Report.cs and receive it from Report1.cs and write it to TSQL query as WHERE clause.
    public partial class MainPage : UserControl, IReportServiceClientFactory
    {
        public MainPage()
        {
            InitializeComponent();

            this.reportViewer1.ReportServiceClientFactory = this;
        }
        #region IReportServiceClientFactory Members

        public Telerik.Reporting.Service.SilverlightClient.ReportServiceClient Create(Uri remoteAddress)
        {
            BasicHttpBinding binding = new BasicHttpBinding();
            binding.MaxReceivedMessageSize = 10485760;
            binding.MaxBufferSize = 10485760;
            binding.ReceiveTimeout = new TimeSpan(00, 10, 00);
            binding.SendTimeout = new TimeSpan(00, 10, 00);
            EndpointAddress endpointAddress = new EndpointAddress(remoteAddress);
           

            return new ReportServiceClient(binding, endpointAddress);
        }

        #endregion
    }
}
