|
I'm uploading an image using this code:
Byte[] file;
using (Stream stream = dlg.OpenFile())
{
var binary = new BinaryReader(stream);
file = binary.ReadBytes((int)stream.Length);
}
return file;
And then to display it on a Crystal Report, I'm using this:
byte[] image = logo.ToArray();
var ds = new LogoDS();
DataTable t = ds.Tables.Add("Items13");
t.Columns.Add("Logo", Type.GetType("System.Byte[]"));
DataRow row = t.NewRow();
row["Logo"] = image;
t.Rows.Add(row);
report.SetDataSource(ds.Tables["Items13"]);
Then I've added this datatable to my report, and then dragged the item onto the report.
But it's not working. If I put a static image on the report, it works just fine, obviously.
Anyone see what I'm doing wrong? THANKS!
|