1
我有以下控制器方法将返回模型中的数据。我如何将所有数据导出为excel?如何在C#中使用Linq将数据导出为excel
public ActionResult iDeal_Table_Display(Guid? SA = null)
{
var iDConfig = webservice.Get_iDealConfigs(SA,null,null,null,null,null,null, out retStatus, out errorMsg);
var model = iDConfig.Select(ic => new iDealModel2
{
SaPrefix = ic.PrefixName,
CalendarCode = ic.CalendarCodeName,
CashnCarry = ic.isCashnCarry,
FreeMM = ic.isFreeMM,
OnContract = ic.isOnContract,
ProductId = ic.ProductName,
RequestTypeId = ic.RequestTypeName
}).ToList();
return PartialView(model);
}
[从C#创建Excel文件(.xls和.XLSX)文件(可能的重复http://stackoverflow.com/questions/151005/create-excel-xls - 和 - XLSX文件从C - 锐) – Steve
即时消息不使用正常连接即时通讯使用LinQ – xSea
你可以使用intropt,使用office和excel dll。 –