Exemple #1
0
        public static XDocument Process(string excelFile)
        {
            IWorkbook            workbook             = WorkbookFactory.Create(excelFile);
            ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();

            excelToHtmlConverter.ProcessWorkbook(workbook);
            return(excelToHtmlConverter.Document);
        }
Exemple #2
0
        private void Test(string fileName)
        {
            HSSFWorkbook workbook;

            workbook = ExcelToHtmlUtils.LoadXls(fileName);
            ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();

            excelToHtmlConverter.ProcessWorkbook(workbook);
            using (var sw = new FileStream(Path.ChangeExtension(fileName, "html"), FileMode.Create))
            {
                excelToHtmlConverter.Document.Save(sw);
            }
        }