convert byte[] array to excel file
convert byte[] array to excel file in asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Alex SmithPosted Jan 28, 2016, 10:30 PM
using Spire.Xls;
namespace WriteArrayToExcel
{
class Program
{
static void Main(string[] args)
{
//initialize a new Workbook class
Workbook wb = new Workbook();
Worksheet sheet = wb.Worksheets[0];
//define a byte Array
byte[] array = new byte[4]{ 0x02, 0x01 ,0x04, 0x03 };
//insert data from byte array to Excel column
sheet.InsertArray(array, 1, 1, true);
//save the changes to file
wb.SaveToFile("sample.xlsx", ExcelVersion.Version2013);
System.Diagnostics.Process.Start("sample.xlsx");
}
}
}
Shubham KumarPosted Jan 28, 2016, 6:55 AM