Пример #1
0
        public void NonStreaming_LargeTable_FileCreated()
        {
            var newExcel     = new SpreadsheetWorkbook();
            var columnsCount = 10;
            var worksheet    = new SpreadsheetWorksheet("Test22");

            for (int i = 0; i < 100000; i++)
            {
                var cells = new List <SpreadsheetCell>();
                for (var j = 0; j < columnsCount; j++)
                {
                    cells.Add(new SpreadsheetCell()
                    {
                        BackgroundColor = Color.Red,
                        ForegroundColor = Color.Blue,
                        Font            = _font,
                        Alignment       = HorizontalAligment.Center,
                        Value           = $"Ovo je test {i} - {j}"
                    });
                }

                var row = new SpreadsheetRow()
                {
                    RowCells = cells
                };
                worksheet.AddRow(row);
            }

            newExcel.AddWorksheet(worksheet);
            newExcel.Save(STR_TestOutputPath);

            Assert.IsTrue(File.Exists(STR_TestOutputPath));
        }
Пример #2
0
        public override void Execute()
        {
            var workBook = new SpreadsheetWorkbook();
            var sheet    = new SpreadsheetWorksheet("Sheet1");

            workBook.AddWorksheet(sheet);

            sheet.AddRow(new SpreadsheetRow()
            {
                RowCells = new List <SpreadsheetCell>()
                {
                    new SpreadsheetCell()
                    {
                        Value = "Hello World!"
                    }
                }
            });

            workBook.Save(OutputFile);
        }
Пример #3
0
        public void Test1()
        {
            var newExcel = new SpreadsheetWorkbook();

            var worksheet = new SpreadsheetWorksheet("Test22");

            worksheet.AddRow(new SpreadsheetRow()
            {
                RowCells = new System.Collections.Generic.List <SpreadsheetCell>()
                {
                    new SpreadsheetCell()
                    {
                        Value = "test"
                    }
                }
            });

            newExcel.AddWorksheet(worksheet);
            newExcel.Save("c:\\temp\\test.xlsx");
        }
Пример #4
0
        public void Save_SingleCell_FileCreated()
        {
            var newExcel = new SpreadsheetWorkbook();

            var worksheet = new SpreadsheetWorksheet("Test22");

            worksheet.AddRow(new SpreadsheetRow()
            {
                RowCells = new System.Collections.Generic.List <SpreadsheetCell>()
                {
                    new SpreadsheetCell()
                    {
                        Value = "test"
                    }
                }
            });

            newExcel.AddWorksheet(worksheet);
            newExcel.Save(STR_TestOutputPath);

            Assert.IsTrue(File.Exists(STR_TestOutputPath));
        }