using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml.Packaging;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
//http://polymathprogrammer.com/2012/08/06/how-to-properly-use-openxmlwriter-to-write-large-excel-files/
string desktop = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
string filename = desktop + "\\test1.xlsx";
using (SpreadsheetDocument xl = SpreadsheetDocument.Create(filename,SpreadsheetDocumentType.Workbook))
{
List<OpenXmlAttribute> oxa;
OpenXmlWriter oxw;
xl.AddWorkbookPart();
WorksheetPart wsp = xl.WorkbookPart.AddNewPart<
openxml写大数据(excel)
最新推荐文章于 2024-08-08 08:28:26 发布
本文介绍如何利用OpenXML库高效地写入大量数据到Excel文件中,避免内存消耗和性能瓶颈,适合大数据场景。
摘要由CSDN通过智能技术生成