我需要构建一个包含多个数据内容的报表查看器,包括来自 MySQL 数据库的图像(mediumBlob)数据字段(不是图像路径)。 我创建了一个包含多个数据表的数据集,然后将它们提供给报告查看器。 当然,图像字段设置为 System.Byte[]。 所有数据都显示正常,但只有图像出现如下错误:
我的代码:
private void finMOM_Load(object sender, EventArgs e)
{
DateTime today = DateTime.Today;
string year = today.Year.ToString();
string month = today.Month.ToString();
string day = today.Day.ToString();
tbxSubject.Text = $"[{ProjectCode}] MOM{year}{month}{day}";
rpvMOM.LocalReport.DataSources.Clear();
DataTable mom = MOMDAO.Instance.LoadMOMByID(MomID);
DataTable attendee = AttendeeDAO.Instance.LoadAttendee(MomID);
DataTable matter = MatterDAO.Instance.LoadMatter(MomID);
ReportDataSource momds = new ReportDataSource("MOM", mom);
ReportDataSource attendeeds = new ReportDataSource("Attendee", attendee);
ReportDataSource matterds = new ReportDataSource("Matter", matter);
rpvMOM.LocalReport.ReportPath = "inMOM.rdlc";
rpvMOM.LocalReport.DataSources.Add(momds);
rpvMOM.LocalReport.DataSources.Add(attendeeds);
rpvMOM.LocalReport.DataSources.Add(matterds);
rpvMOM.RefreshReport();
}
请帮我解决这个问题。 预先感谢您。