I want to display the selected image from datagridview in the image RDLC report .
I tried with this code but it doesn't work .
Not working :(
- private void btnPrint_Click(object sender, EventArgs e)
- {
- frmPrint frm = new frmPrint();
-
- frm.reportViewer1.LocalReport.DataSources.Clear();
- frm.reportViewer1.LocalReport.ReportEmbeddedResource = "XmlView.Report1.rdlc";
- frm.reportViewer1.LocalReport.EnableExternalImages = true;
- DataGridViewCell dgcell = gvData.SelectedRows[0].Cells[12];
- if (dgcell.Tag != null)
- {
- string imgCode = dgcell.Tag.ToString();
- byte[] bytes = Convert.FromBase64String(imgCode);
-
- ReportParameter[] parms = new ReportParameter[1];
- parms[0] = new ReportParameter("txtImage", imgCode);
- frm.reportViewer1.LocalReport.SetParameters(parms);
- frm.reportViewer1.RefreshReport();
- frm.reportViewer1.LocalReport.Refresh();
- frm.ShowDialog();
- }
- }
Thanks in Advance