我只将图片名称存储在数据库中,实际图片存储在项目目录“SiteImages”中。
现在我想在 RDLC 报告中显示图像但不显示。代码:
public void Fill_AuditsReport()
{
ReportViewer1.AsyncRendering = false;
ReportViewer1.SizeToReportContent = true;
ReportViewer1.ZoomMode = ZoomMode.FullPage;
this.ReportViewer1.Reset();
DataTable dt = new DataTable();
PersonalInfo.ManagePersonalInfo MngPersonalInfo = new PersonalInfo.ManagePersonalInfo();
dt = MngPersonalInfo.ReportSelectPersonalInfo();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/DataManagementReports/Report.rdlc");
ReportDataSource rpds = new ReportDataSource("DataSetPersonalInfo", dt);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rpds);
ReportViewer1.Visible = true;
}
数据库中字段的名称是PersonalInfoEmployeePicture。