小编Moh*_*ufi的帖子

当路径位于 RDLC 报告中的数据库中时显示文件夹中的图像

如何显示位于文件夹中且路径位于数据库中的学生图片但我无法执行此操作我搜索了很多但没有找到任何有用的东西。请帮助我伙计们

在此输入图像描述 我变得这样

            protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
            {
                string query = @"select StudentID,c.DocumentType as DocumentID,DocumentNumber,Name,NameDari,FatherName,FatherNameDari,MobileNumber,Photo,b.ClassName as ClassID,d.LocationName as LocationID,e.TeacherName as TeacherID,a.Term,a.Score from StudentsInfo a 
join Class b 
on a.ClassID=b.ClassID
join Document c
on c.DocumentID=a.DocumentID
join Location d
on d.LocationID=a.LocationID
join Teachers e
on e.TeacherID=a.TeacherID";
                var data = db.Database.SqlQuery<StudentsInfo>(query);
                ReportViewer1.SizeToReportContent = true;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("Certificates.rdlc");

                ReportViewer1.LocalReport.DataSources.Clear();
                ReportDataSource ds = new ReportDataSource("Certificates", data);
                ReportViewer1.LocalReport.DataSources.Add(ds);
                this.ReportViewer1.LocalReport.EnableExternalImages = true;
                ReportViewer1.LocalReport.Refresh();
            }

        }
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc rdlc

1
推荐指数
1
解决办法
6052
查看次数

标签 统计

asp.net-mvc ×1

rdlc ×1