예제 #1
0
 public ExcelResult(ExcelEngine engine, IWorkbook source, string fileName, HttpResponse response, ExcelDownloadType downloadType, ExcelHttpContentType contentType)
 {
     this.FileName = fileName;
     this.m_source = source;
     this.m_engine = engine;
     m_response    = response;
     DownloadType  = downloadType;
     ContentType   = contentType;
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="_workbook"></param>
        /// <param name="filename"></param>
        /// <param name="response"></param>
        /// <param name="DownloadType"></param>
        /// <returns></returns>
        public static XlsResult SaveAsActionResult(this ExcelEngine _engine, IWorkbook _workbook, string filename, HttpResponse response, ExcelDownloadType DownloadType)
        {
            ExcelHttpContentType contentType = ExcelHttpContentType.Excel2007;

            if (_workbook.Version == ExcelVersion.Excel2007)
            {
                contentType = ExcelHttpContentType.Excel2007;
            }
            else if (_workbook.Version == ExcelVersion.Excel97to2003)
            {
                contentType = ExcelHttpContentType.Excel2000;
            }
            return(new XlsResult(_engine, _workbook, filename, response, DownloadType, contentType));
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="_workbook"></param>
 /// <param name="filename"></param>
 /// <param name="saveType"></param>
 /// <param name="response"></param>
 /// <param name="DownloadType"></param>
 /// <param name="contentType"></param>
 /// <returns></returns>
 public static XlsResult SaveAsActionResult(this ExcelEngine _engine, IWorkbook _workbook, string filename, string separator, HttpResponse response, ExcelDownloadType DownloadType, ExcelHttpContentType contentType)
 {
     return(new XlsResult(_engine, _workbook, filename, separator, response, DownloadType, contentType));
 }