2017-08-19 53 views
0

我將收集圖像存儲在數據庫中(創建字段img爲byte []),並且當傳入到stimulsoft報告中時未顯示。 我嘗試在字體[]或圖像中的stimulsoft設計器中創建字段img ...但不起作用。 如何顯示它?來自數據庫的圖像數據未顯示在stimulsoft報告中

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(); 
+0

請分享一些代碼來說明您的問題。 –

回答

0

應使用字節數組(字節[])來發送圖像:

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

並嘗試發送的數組。那麼您應該將參數分配給Stimulsoft中的圖像(通過使用DataColumn屬性)。

相關問題