使用NPOI 转换Excel TO HTML (导出格式不如原生Excel好看)

            //HSSFWorkbook workbook = ExcelToHtmlUtils.LoadXls(strPath);

            //ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();

            //// Set output parameters
            //excelToHtmlConverter.OutputColumnHeaders = true;
            //excelToHtmlConverter.OutputHiddenColumns = false;
            //excelToHtmlConverter.OutputHiddenRows = false;
            //excelToHtmlConverter.OutputLeadingSpacesAsNonBreaking = true;
            //excelToHtmlConverter.OutputRowNumbers = true;
            //excelToHtmlConverter.UseDivsToSpan = true;

            //// Process the Excel file
            //excelToHtmlConverter.ProcessWorkbook(workbook);

            //var htmlFile = HttpContext.Current.Server.MapPath("/") + "doc\\" + fileName + ".html";
            //// Output the HTML file
            //excelToHtmlConverter.Document.Save(htmlFile);

            //docHtmlUrl = "http://" + HttpContext.Current.Request.Url.Host + ":" +
            //    HttpContext.Current.Request.Url.Port + "/doc/" + fileName + ".html";

  

posted @ 2016-06-24 15:49  iDEAAM  阅读(2473)  评论(1编辑  收藏  举报