在html表中读取Excel工作表数据 [英] read a excel sheet data in html table
本文介绍了在html表中读取Excel工作表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想将Excel工作表数据读取到html表中.
我正在研究MVC框架.
[controller]
Hi All,
I want to read an excel sheet data into an html table.
I am working on MVC framework.
[controller]
public ActionResult ExcelRead()
{
try
{
string[,] TestArray = new string[3, 5];
FileInfo newFile = new FileInfo(Server.MapPath(@"\Content\ExcelPackageNewFile.xlsx"));
using (ExcelPackage xlPackage = new ExcelPackage(newFile))
{
ExcelWorkbook myWorkbook = xlPackage.Workbook;
// Getting the worksheet by its name...
ExcelWorksheet myWorksheet = myWorkbook.Worksheets["Sheet1"];
//I want to read excel data here, please help me,Iam very new to this
}
return RedirectToAction("ExcelRead");
}
catch (Exception ex)
{
return RedirectToAction("ExcelRead");
}
}
推荐答案
请转到以下链接...
^ ]
http://excelpackage.codeplex.com/wikipage?title=中读取%20data%20从%20an%20Excel%20spreadsheet& referringTitle = Home [%<
Please, go to the following link...
http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c13123__1/Using-ExcelPackage-to-Create-Excel-2007-Files-on-the-Server.htm[^]
http://excelpackage.codeplex.com/wikipage?title=Reading%20data%20from%20an%20Excel%20spreadsheet&referringTitle=Home[^]
I believe this link dives quite deep in ExcelPackage
这篇关于在html表中读取Excel工作表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文