TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Madhav
NA
196
43k
display image on crystal report using web.config file
May 23 2016 12:33 AM
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
<appSettings>
<add key="logo" value="Images/1.jpg" />
</appSettings>
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
Reply
Answers (
1
)
document viewer
How to understand mvc in easy way