Display Image in Page Header & Footer Section in RDLC Report (Microsoft Report Viewer)

Display Image in Header RDLC Report

1. Add  .Rdlc Report in Project and Add one DataSet (Containing Image Field Name)

AddDataset.JPG
       
2. Add Header Section in RDLC Report
      go to --> menu -->Report -->add Page Header and Page Footer
     
3. From ToolBox  Drag and Drop Text Box in  Body Section

        example :-  Add one text box Name Picture
           
        Select textbox(Picture) go to property change 
        Value =Convert.ToBase64String(Fields!Picture.Value)
Header Image.JPG
 
4. Now Display image in Header 
      use value of textbox(Picture)
Heade Image Change Property.jpeg


 5. Write Select Statement 
       
          using (SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["Connection"].ToString()))
            {
                cn.Open();
                using (SqlCommand cmd = new SqlCommand("select Picture  from tblImage", cn))
                {
                    
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        DataSet ds = new DataSet();
                        da.Fill(ds, "DataSet1_DataTable1");
                        ReportDataSource rds = new ReportDataSource("DataSet1_DataTable1", ds.Tables[0]);
                        ReportViewer1.LocalReport.DataSources.Clear();
                        ReportViewer1.LocalReport.DataSources.Add(rds);
                        ReportViewer1.LocalReport.Refresh();
                                            
                    }
                
                }


Display Image into RDLC HEADER
HeaderRDLC.JPG


  Same way You can Display Image in Footer Section.