Exemple #1
0
        public void XlsFormDefBuilderTest()
        {
            using (var dataContext = new DataContext())
            {
                var formRepo = new FormRepository(dataContext);
                var form     = formRepo.GetDetailForm(Guid.Parse("{90958557-E6B0-40A8-88D8-75B71130D5FC}"));

                var docRepo = new DocRepository(dataContext);
                var doc     = docRepo.LoadById(Guid.Parse("626b662c-17a9-4f70-9a06-13d2337a681a"));

                var defBuilder = new XlsFormDefBuilder(dataContext, form, Guid.Empty);
                var def        = defBuilder.Build(doc);
                def.Style.Borders = TableCellBorder.All;

                var builder  = new XlsBuilder(def);
                var workbook = builder.Build();
                using (var stream = new FileStream(@"c:\distr\cissa\testXlsDefAppForm.xls", FileMode.Create))
                {
                    workbook.Write(stream);
                }
            }
        }