45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Eson.Utils.ExcelHelper
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Excel导出帮助类
|
|||
|
/// </summary>
|
|||
|
public class ExcelHelper
|
|||
|
{
|
|||
|
private static ExcelHelper _instance;
|
|||
|
/// <summary>
|
|||
|
/// 实例化导出Excel帮助类
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static ExcelHelper GetInstance()
|
|||
|
{
|
|||
|
if (_instance == null)
|
|||
|
_instance = new ExcelHelper();
|
|||
|
return _instance;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 调用Excel模板形式导出Excel(在需要特殊样式时可使用自己设置好样式的模板导出Excel,通常情况下建议使用内存流形式导出)
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public ExcelFileExport ExportWithFile()
|
|||
|
{
|
|||
|
return new ExcelFileExport();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 调用内存流形式导出Excel
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public ExcelStreamExport ExportWithStream()
|
|||
|
{
|
|||
|
return new ExcelStreamExport();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|