来自数据库的图像数据未显示在stimulsoft报告中

时间:2017-08-19 07:18:54

标签: c# reporting stimulsoft

我将收藏图像存储在数据库中(创建字段img as byte []),当传递到stimulsoft报告时没有显示。 我尝试在stimulsoft设计器中创建字段img作为byte []或image ...但是不起作用。 如何显示?

var imgConverter = new ImageConvert();
var report = new StiReport();
var t = new DataTable();

t.Columns.Add("Img");

foreach (DataGridViewRow dgv in dataGridViewX3.Rows)
{
    t.Rows.Add(
       imgConverter.ByteArrayToImage((byte[])dgv.Cells["BarcodeImg"].Value)
    );
}
report.Load("BarcodeReport.mrt");
report.RegData("DSBarcode", t);
report.Compile();
report.Show();

1 个答案:

答案 0 :(得分:0)

你应该使用一个字节数组(byte [])来发送图像:

dtModel.Columns.Add("Pic", typeof(byte[]))

并尝试发送数组。然后你应该将参数分配给Stimulsoft中的图像(通过使用DataColumn属性)。

相关问题