Пример #1
0
        public static string WriteDebugFile(Matrix mat, string filename, IXLWorkbook wb = null, List <Stream> streamsToClose = null, IFormatApplier formatApplier = null)
        {
            if (wb is null)
            {
                wb = new XLWorkbook();
            }
            if (formatApplier is null)
            {
                formatApplier = new ClosedXmlFormatApplier();
            }

            var rd             = new ClosedXmlRenderer(wb, formatApplier);
            var targetFilename = TestUtils.GetFileName(filename);
            var fs             = File.Create(targetFilename);

            if (streamsToClose != null)
            {
                streamsToClose.Add(fs);
            }
            rd.GenerateExcelFile(mat, fs);
            return(targetFilename);
        }