Conver Byte to Excel

Hi

How to convert a Byte[] to execl, that is an excel file stored as bytes in database into a Excel file

Hi Ajeesh,

Thanks for your query. It seems that your query is more related to Aspose.Cells. I am moving this thread to Aspose.Cells forum and my colleagues will update you shortly with exact information.

Hi,

Workbook has many overloaded constructors, one of them takes input stream.

You need to convert your byte array into input stream, suppose you have a file in a byte array with the name bytes, so your code will look like this to create a workbook object.

C#


//Create a memory stream from byte array

MemoryStream ms = new MemoryStream();

ms.Write(bytes, 0, bytes.Length);

ms.Position = 0;


//Create a workbook object from memory input stream

Workbook workbook = new Workbook(ms);


Java
//Create input stream from byte array
ByteArrayInputStream bin = new ByteArrayInputStream(bytes);

//Create workbook object from byte input stream
Workbook workbook = new Workbook(bin);