Show Image on Excel using Smart Markers

Hi


I am using smart markers to display data in Excel. The thing I have done is retrieving DataTable from database and then I add a new column to store array byte for image.

DataTable dt = GetAllRecords();
dt.Columns.Add(“ImageData”, typeof(object));

foreach (DataRow row in data.Rows)
{
if (row[“RecordId”] != null)
{
string RecordId = row[“RecordId”].ToString();
row[“ImageData”] = GetImage(RecordId);
}
}
GetImage function returns byte[].

And in Excel I am using &=[Records].ImageData(Picture:FitToCell)
When I generate data then everything is perfect except Image. Image cell show “System.Byte[]” instead of image.

I also tried an alternate way to store byte array i.e.
row["ImageData’} = Convert.ToBase64String(GetImage(RecordId));

This method display a binary array like this
/9j/4AAQSkZJRgABAAEAZABkAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMQD/2wCEAAUFBQgFCAwHBwwMCQkJDA0MDAwMDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N

So Please provide me way to display Image in excel using Smart Markers.

Thanks

Hi,

Thanks for your posting and using Aspose.Cells.

Please see the following post. It should help you in showing the image inside the Excel file using Smart Markers.

( Image with smart markers )

Let us know your feedback.