Example #1
0
        static void Main(string[] args)
        {
            HSSFWorkbook workbook;
            //the excel file to convert
            string fileName = "19599-1.xls";
            fileName = Path.Combine(Environment.CurrentDirectory, fileName);
            workbook = ExcelToHtmlUtils.LoadXls(fileName);


            ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();

            //set output parameter
            excelToHtmlConverter.OutputColumnHeaders = false;
            excelToHtmlConverter.OutputHiddenColumns = true;
            excelToHtmlConverter.OutputHiddenRows = true;
            excelToHtmlConverter.OutputLeadingSpacesAsNonBreaking = false;
            excelToHtmlConverter.OutputRowNumbers = true;
            excelToHtmlConverter.UseDivsToSpan = true;

            //process the excel file
            excelToHtmlConverter.ProcessWorkbook(workbook);

            //output the html file
            excelToHtmlConverter.Document.Save(Path.ChangeExtension(fileName, "html"));
        }
 private void Test(string fileName)
 {
     HSSFWorkbook workbook;
         workbook = ExcelToHtmlUtils.LoadXls(fileName);
         ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();
         excelToHtmlConverter.ProcessWorkbook(workbook);
         excelToHtmlConverter.Document.Save(Path.ChangeExtension(fileName, "html")); ;
 }
Example #3
0
        public static XmlDocument Process(string xlsFile)
        {
            HSSFWorkbook         workbook             = ExcelToHtmlUtils.LoadXls(xlsFile);
            ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();

            excelToHtmlConverter.ProcessWorkbook(workbook);
            return(excelToHtmlConverter.Document);
        }
Example #4
0
 public static XmlDocument Process(string xlsFile)
 {
     HSSFWorkbook workbook = ExcelToHtmlUtils.LoadXls(xlsFile);
     ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();
     excelToHtmlConverter.ProcessWorkbook(workbook);
     return excelToHtmlConverter.Document;
 }