Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 15, 2013 05:27 AM by Dylan Clifford
Jun 21, 2010 12:09 PM|LINK
I am working on implementing exporting data to Excel functionality in ASP.Net and as part of that an image stored in the database has to be exported to Excel along with some other content. I am able to write the content to Excel by referring to the required
cells. Is it possible to write the image byte stream read from the database which is in the form of byte directly to Excel sheet without saving that to physical disk?
Please suggest how to write image byte stream to Excel without saving the image to physical disk?
Export image to Excel
Jul 10, 2010 07:28 AM|LINK
Well i haven't tried what exactly you want to achieve but i managed to render a report content having images from binary format.
I suggest you to use Response object of ASP.Net.
Here is a sample code snippet..
Response.ContentType = "application/excel";
Response.BinaryWrite(byteData); // Writing byte array
Jul 10, 2010 10:45 AM|LINK
hope this helps..
Sep 20, 2010 10:43 AM|LINK
No you can not export image into excel by .net use third party control :-)
Feb 15, 2013 05:27 AM|LINK
you can use this
.Net component to insert image byte stream to Excel.
Look at this C# example:
ExcelWorkbook wb = new ExcelWorkbook();
wb.Worksheets.Cells[0, 0].Value = "Vasya vodit volvo";
ExcelWorksheet Wsh = wb.Worksheets;
Wsh.Pictures.Add(new MemoryStream(buf)); //buf is your byte array
Wsh.Pictures.SetPosition(0, 0, 1, 1);