views:

988

answers:

1

How Can I change an Image (its an OLE Object) in a Crystal report using C#?

A: 

Suppose you have your image in a Bitmap object, save it to MemoryStream in Bitmap format,
Create a DataSource, create DataTable in it with 1 DataColumn with type of byte array

MemoryStream ms; //contains saved bitmap~!!!
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("img", typeof(Byte[])));
DataRow row = dt.NewRow();
row["img"] = ms.ToArray();

also have the report (or subreport of your report) bound to DataSource with schema as above insert Image object bound to the "img" column to report

Axarydax