4
Reply

Display image in ReportViewer with a parameter

abdelwaheb ammar

abdelwaheb ammar

Nov 15 2016 1:49 PM
427
Good evening, I try to display an image in a reportViewer from a send path as a parameter.
Here is my code that I insert:
 
  1. public partial class PrintFiche : Form  
  2.    {  
  3.        public PrintFiche()  
  4.        {  
  5.            InitializeComponent();  
  6.        }  
  7.   
  8.        private void PrintFiche_Load(object sender, EventArgs e)  
  9.        {  
  10.            reportViewer1.LocalReport.ReportPath = "D:\\workspace\\Report\\FichePersonne.rdlc";  
  11.   
  12.            ReportParameter lim = new ReportParameter("image",@"C:\Documents and Settings\Mes images\Échantillons d'images\Collines.jpeg"true);  
  13.            reportViewer1.LocalReport.EnableExternalImages = true;  
  14.            reportViewer1.LocalReport.SetParameters(new ReportParameter[] {lim} );  
  15.            this.reportViewer1.RefreshReport();  
  16.   
  17.        }  
  18.    }  
 But the result I get is an image in X form
 
 
 what is the mistake in this code ?

Answers (4)