我怎样才能将图像从数据库发送到 stimulsoft web 报告

how can i send an image to stimulsoft web report from database

我是 Stimulsoft 报告的新手 我想将数据库 sql 中的图像发送并显示到 Stimulsoft 报告。 我该怎么做? 我使用 asp.net C# 我在后面的代码中创建了一个数据表并将数据设置到数据表中以绑定到报告 这个数据表的一个字段是图像数据类型,我用 System.Drowing.Image 对象填充它。

string normalPath = Server.MapPath("Pics\Other\PrintPage.gif");
FileStream fsN = new FileStream(normalPath, FileMode.Open, FileAccess.Read);
System.Drawing.Image normalImage = new System.Drawing.Image.FromStream(fsN);
fsN.Close();

DataTable result = new DataTable();
result.Columns.AddRange(new DataColumn[5]{
new DataColumn("LineNumber",typeof(int)),
new DataColumn("SerialNumber",typeof(int)),
new DataColumn("ActivationCode",typeof(string)),
new DataColumn("DetectorTypeId",typeof(int)),
new DataColumn("Image",typeof(System.Drawing.Image))
});

Stimulsoft.Report.StiReport stiReport = new Stimulsoft.Report.StiReport();
ds.Tables.Add(result);
stiReport.Load(Server.MapPath("CustomerActivator.mrt"));
stiReport.Render();
stiReport.RegData("Data", result);
StiWebViewer1.Report = stiReport;
StiWebViewer1.Visible = true;

您应该在报告模板中设置图像的数据列属性。