我正在尝试在水晶报表中显示图像。在下面的代码中,我在文件流中转换图像路径,然后通过数据表添加报告源。但没有显示静止图像
string path;
DataTable dt = new DataTable();
path = Server.MapPath("~/img/logo.jpg");
DataColumn column = new DataColumn("Image"); //Create the column.
column.DataType = System.Type.GetType("System.Byte[]");
dt.Columns.Add(column);
DataRow row = dt.NewRow();
FileStream fs = new FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);
Byte[] Image = new Byte[fs.Length];
fs.Read(Image, 0, Convert.ToInt32(fs.Length));
fs.Close();
row["Image"] = Image;
dt.Rows.Add(row);
dss.Tables[0].Merge(dt);
//set dataset to the report viewer.
rptDoc.SetDataSource(dss);
CrystalReportViewer1.ReportSource = rptDoc;