EPPlus save two million rows with 200+ columns datatable to multiple excel files

后端 未结 4 865
时光说笑
时光说笑 2021-01-07 01:59

I have function that saves all records from SQL table to excel worksheet using EPPlus. If I export small amount of data everything works fine, but with 200+ columns and 500

4条回答
  •  广开言路
    2021-01-07 02:49

    Since you are creating a new excel file (correct me if I'm wrong), you can simply write an XML file with some specific contents. Excel supports .xml files if they contain the correct stuff.

    You can simply create the contents of the XML file in-memory, and afterwards write this contents to an .XML file. You do not need the EPPlus package, therefore you are bypassing the limitations of the EPPlus package.

    Of course, you have to figure out manually what you need to write in the .XML file. Of you are going to use formatting and formulas, it might be a complex.

    See here:

    • https://www.google.nl/search?q=excel%2520xml%2520format&oq=excel%2520xml%2520format
    • https://technet.microsoft.com/en-gb/magazine/2006.01.blogtales.aspx
    • http://blogs.msdn.com/b/brian_jones/archive/2005/06/27/433152.aspx

提交回复
热议问题