Hi,
I have requirement to assign Image to Crystal Report at run time.
I datasource for the reports is dataset.
So I created a Datatable having column of type System.Byte[],
i used the below code.
DataTable
dtImage = new DataTable("Image");
dtImage.Columns.Add("Img", Type.GetType("System.Byte[]"));
string strFileName = "Image.JPG";
if (strFileName != "" && File.Exists(strFileName))
{
FileStream fsStream = new FileStream(strFileName, FileMode.Open);
BinaryReader brReader = new BinaryReader(fsStream);
DataRow drRow = dtImage.NewRow();
drRow[0] = brReader.ReadBytes(
Convert.ToInt32(brReader.BaseStream.Length));
dtImage.Rows.Add(drRow);
fsStream.Close();
fsStream.Dispose();
fsStream =
null;
brReader =
null;
}
when i try assigning dtImage as the datasource to reports,i dont see any assignment of new iMage,
Am i missing anything in the code.
Regards
Vinutha