Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a .rdlc file where have some parameters. and i want to assign that parameters value from code behind file (.cs file).
Please help me
Posted

1 solution

Use this type of code .. Defiantly you will solve your Problem

C#
ReportViewer1.LocalReport.EnableExternalImages = true;
            string imagePath = new Uri(Server.MapPath(ds.Tables[0].Rows[0]["sImg"].ToString())).AbsoluteUri;
            ReportParameter rp1 = new ReportParameter("img", imagePath);
            string imagePath1 = new Uri(Server.MapPath(ds.Tables[0].Rows[0]["pimg"].ToString())).AbsoluteUri;
            ReportParameter rp2 = new ReportParameter("priImg", imagePath1);
            string imagePath3 = new Uri(Server.MapPath(ds.Tables[0].Rows[0]["sign"].ToString())).AbsoluteUri;
            ReportParameter rp3 = new ReportParameter("presiImg", imagePath3);
            string imagePath4 = new Uri(Server.MapPath(ds.Tables[0].Rows[0]["signsecretary"].ToString())).AbsoluteUri;
            ReportParameter rp4 = new ReportParameter("secImg", imagePath4);
            //ReportViewer1.LocalReport.SetParameters(parameter);


            ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp2,rp3,rp4 });



Note: Here ds is DataSet Class object Which have the image physical path.

Thanks
AARIF SHAIKH
 
Share this answer
 
v3
Comments
Divyam Sharma 4-Oct-14 7:12am    
Thanks for Reply..
I am just trying to solve my problem.
aarif moh shaikh 4-Oct-14 7:33am    
your welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900