//報表
CargBillReport CBR = new CargBillReport();
//新增一個欄位
dt.Columns.Add("barcode",System .Type.GetType ("System.Byte[]"));
//圖片
byte[] img = System.IO.File.ReadAllBytes("C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\Water lilies.jpg");
//加入圖片
dt.Rows[0]["barcode"] = img;
//填入報表
CBR.SetDataSource(dt);
//預覽
crystalReportViewer1.ReportSource = CBR;
全站熱搜