title: How can I dynamically add an image logo to ReportViewer Parameters?
body: <p>I need help adding an image logo in ReportViewer dynamically. I get this image from db, convert it to Base64, and then I need to add it in ReportViewer... This code next:</p>
  
  <pre><code>rpViewer.LocalReport.EnableExternalImages = true;
  
          Company _company = db.Companys.Where(c =&gt; c.codCompany == c.codCompany).Single();
  
          //first step
          byte[] img = _company.imagem.ToArray();   //  i get image from db
          MemoryStream _ms = new MemoryStream(img);
  
          string logo = Convert.ToBase64String(img); //convert to base64
  
          // 2 step  
          List&lt;ReportParameter&gt; lstReportParams = new List&lt;ReportParameter&gt;();//Create params
          lstReportParams.Add(new ReportParameter("Logo", logo));
          lstReportParams.Add(new ReportParameter("LogoMimeType", "image/png"));
  
          // Doesn't work here (see error below)
          this.rpViewer.LocalReport.SetParameters(lstReportParams); 
  
          this.rpViewer.RefreshReport();
  </code></pre>
  
  <p>The error:</p>
  
  <blockquote>
    <p>{"An error occurred during local report processing."}<br>
    {"An attempt was made to set a report parameter 'Logo' that is not defined in this report."}</p>
  </blockquote>
  
  <p>In Rldc:</p>
  
  <pre><code>MIMEType =Parameters!LogoMimeType.value
  Value ="System.Convert.FromBase64String(Parameters!Logo.Value)" 
  </code></pre>
  
  <p>Why doesn't it work? </p>
  
  <p>Why is not recognizing the parameter?</p>
  
  <p>I can load that image in ReportViewer.</p>