Exemplo n.º 1
0
        private static bool ExportToExcelFile(string AFilename, HtmlDocument AHTMLDocument)
        {
            // transform the HTML output to xlsx file
            ExcelPackage ExcelDoc = HTMLTemplateProcessor.HTMLToCalc(AHTMLDocument);

            if (ExcelDoc != null)
            {
                using (FileStream fs = new FileStream(AFilename, FileMode.Create))
                {
                    ExcelDoc.SaveAs(fs);
                    fs.Close();
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private static bool ExportToExcelFile(string AFilename, HtmlDocument AHTMLDocument)
        {
            // transform the HTML output to xlsx file
            XSSFWorkbook workbook = HTMLTemplateProcessor.HTMLToCalc(AHTMLDocument);

            if (workbook != null)
            {
                using (FileStream fs = new FileStream(AFilename, FileMode.Create))
                {
                    workbook.Write(fs);
                    fs.Close();
                }

                return(true);
            }

            return(false);
        }