title: Display logo in rdlc report header from database in wpf Using Parameter
body: <p>Code:</p>
  
  <pre><code>private bool _isReportViewerLoaded;
  
  private void reportViewer_Load(object sender, EventArgs e)
  {
      if (!_isReportViewerLoaded)
      {
          Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
          SellMechDataSet dataset = new SellMechDataSet();
          dataset.BeginInit();
          reportDataSource1.Name = "DataSet2";
          //Name of the report dataset in our .RDLC file
          reportDataSource1.Value = dataset.tblLogo;
          this.reportViewer.LocalReport.DataSources.Add(reportDataSource1);
          this.reportViewer.LocalReport.ReportPath = "D:\\17-6-2016\\ShellMechProject\\demo\\Reports\\CustomerList.rdlc ";
          dataset.EndInit();
          //fill data into WpfApplication4DataSet
          SellMechDataSetTableAdapters.tblLogoTableAdapter accountsTableAdapter = new SellMechDataSetTableAdapters.tblLogoTableAdapter();
          accountsTableAdapter.ClearBeforeFill = true;
          accountsTableAdapter.Fill(dataset.tblLogo);
          string ImagePath = "";
  
          if (con.State != ConnectionState.Open)
              con.Open();
          {
              SqlCommand cmd = new SqlCommand("SELECT * FROM tblLogo", con);
              SqlDataReader dr;
              dr = cmd.ExecuteReader();
              while (dr.Read())
              {
                  ImagePath = dr["ImagePath"].ToString();
  
              }
          }
          ReportParameter rp = new ReportParameter("Path", ImagePath);
          rp.Name = "Path";
          //rp.Values = ImagePath;
          reportViewer.LocalReport.SetParameters(new ReportParameter[] { rp });
          reportViewer.RefreshReport();
          _isReportViewerLoaded = true;
      }
  }
  </code></pre>
  
  <p>Design:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Window x:Class="demo.Reports.CustomerList"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
         xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" 
         Icon="/img\F_Logo.png"
         WindowStyle="None"
         ShowInTaskbar="False"
         Title="Customer Report" Height="742.955" Width="1140.164"  WindowStartupLocation="CenterOwner" ResizeMode="NoResize"  Loaded="Window_Loaded"&gt;
      &lt;Grid Margin="-1,2,1,-172"  Background="#d9f9f7" Height="913" VerticalAlignment="Top"&gt;
          &lt;Label Content="Customer Report" VerticalAlignment="Top" Height="25" HorizontalContentAlignment="Center" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" Margin="-1,-2,0.2,0"&gt;&lt;/Label&gt;
          &lt;Button Content="X" Name="btnExit"  Grid.Row="0" Height="20" Width="20" FontFamily="Times New Roman" Foreground="Red" FontWeight="Bold" FontSize="18" Margin="1118,0,2,893" RenderTransformOrigin="4.564,0.572" Click="btnExit_Click"  /&gt;
          &lt;Grid Margin="0,23,0,-23"&gt;
              &lt;WindowsFormsHost Name="windowsFormsHost1"&gt;
                  &lt;rv:ReportViewer x:Name="reportViewer" Load="reportViewer_Load" /&gt;
              &lt;/WindowsFormsHost&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>I am fetching path from database and display it into image control 
  but error occur</p>
  
  <blockquote>
    <p>An error occurred during local report processing.</p>
  </blockquote>
  
  <p>If any other option are available in wpf report logo.</p>