水晶报表动态加载图片,无法显示
dataset里有张myLogo表:pic1,pic2字段,在crystalReport2.rpt的详细资料里托了这两个字段,但还是无法显示图片,请指点
代码如下:
ReportDocument myReport = new ReportDocument();
private void Crystal_Load(object sender, EventArgs e)
{
DataSet1 ds1 = new DataSet1();
FileStream fs = new FileStream(@"D:\Images\1.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br1 = new BinaryReader(fs);
byte[] byte1 = br1.ReadBytes((int)fs.Length);
FileStream fs1 = new FileStream(@"D:\Images\22.bmp", FileMode.Open, FileAccess.Read);
BinaryReader br2 = new BinaryReader(fs1);
byte[] byte2 = br2.ReadBytes((int)fs1.Length);
fs.Close();
fs1.Close();
ds1.myLogo.AddmyLogoRow(byte1, byte2);
//string reportPath = Application.StartupPath + "\\CrystalReport2.rpt";
//myReport.Load(reportPath);
//CrystalReport2 crt2 = new CrystalReport2();
//myReport.SetDataSource(ds1);
CrystalReport2 crt2 = new CrystalReport2();
crt2.SetDataSource(ds1);
crystalReportViewer1.ReportSource = crt2;
//crystalReportViewer1.Refresh();
}
麻烦帮我改改或是指出怎么改