Convert byte[] array to excel file
convert byte[] array to excel file in asp.net
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shubham KumarRank #621 · 3.8K reputationPosted Jan 28, 2016, 1:55 AM EST
Alex SmithRank #4,089 · 366 reputationPosted Jan 28, 2016, 5:30 PM EST
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");
}
}
}