here i want to display image on crystal report using web.config file in which i am storing image path ,from folder in which i have images in solution
here i added image path in web.config file within appsetting section like bellow
and i have tried code as bellow in c#
CrystalReportViewer1.Visible = true;
string imagePath = ConfigurationManager.AppSettings["logo"];
string physicalPath = Server.MapPath(imagePath);
ReportDocument rd = new ReportDocument();
CrystalReportViewer1.RefreshReport();
ParameterFields myParams = new ParameterFields();
ParameterField myParam = new ParameterField();
ParameterDiscreteValue myDiscreteValue = new ParameterDiscreteValue();
myParam.ParameterFieldName = "logo";
myDiscreteValue.Value = physicalPath;
myParam.CurrentValues.Add(myDiscreteValue);
myParams.Add(myParam);
CrystalReportViewer1.ParameterFieldInfo = myParams;
rd.Load(Server.MapPath("CrystalReport2.rpt"));
CrystalReportViewer1.ReportSource = rd;
CrystalReportViewer1.DataBind();
but the crystal report viewer doesn't rendering any thing,can any one help me regarding this issue
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
MadhavPosted May 23, 2016, 2:34 AM