示例#1
0
        protected void EmployeesGrid_ServerWordExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)
        {
            WordExport    exp      = new WordExport();
            IWordDocument document = exp.Export(EmployeesGrid.Model, (IEnumerable)EmployeesGrid.DataSource, "Export.docx", true, true, "flat-lime", true);

            exp.Export(OrdersGrid.Model, (IEnumerable)OrdersGrid.DataSource, "Export.docx", true, true, "flat-lime", false, document, "Second Grid");
        }
    protected void FlatGrid_ServerWordExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)

    {
        WordExport exp = new WordExport();

        exp.Export(FlatGrid.Model, (IEnumerable)FlatGrid.DataSource, "Export.docx", true, true, "flat-lime");
    }
示例#3
0
        public void ExportToWordGenero(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = context.Generoes.ToList();
            GridProperties obj        = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);

            exp.Export(obj, DataSource, "WordGenero.docx", false, false, "flat-saffron");
        }
        public void ExportToWord(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = new NorthwindDataContext().OrdersViews.Take(100).ToList();
            GridProperties obj        = ConvertGridObject(GridModel);

            exp.Export(obj, DataSource, "Export.docx", false, false, "flat-saffron");
        }
示例#5
0
        public static void ExportToWord(string gridModel, IEnumerable data, string fileName, string theme)
        {
            GridProperties gridProperties = ModelToObject(gridModel);

            WordExport export = new WordExport();

            export.Export(gridProperties, data, fileName, false, false, theme);
        }
        public void ColumnTemplateToWord(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = new NorthwindDataContext().EmployeeViews.Take(8).ToList();
            GridProperties obj        = ConvertGridObject3(GridModel);

            obj.WordColumnTemplateInfo = WordTemplateInfo;
            exp.Export(obj, DataSource, "Export.docx", false, true, "flat-saffron");
        }
示例#7
0
        public ActionResult ExportToWord(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = _context.Orders.Take(100).ToList();
            GridProperties gridProp   = ConvertGridObject(GridModel);
            GridWordExport wrdExp     = new GridWordExport();

            wrdExp.FileName = "Export.docx"; wrdExp.Theme = "flat-saffron";
            return(exp.Export(gridProp, DataSource, wrdExp));
        }
示例#8
0
        public void ExportToWord(string GridModel)
        {
            WordExport exp        = new WordExport();
            var        DataSource = TempData["ExportData"];

            TempData["ExportData"] = DataSource;
            GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);

            exp.Export(obj, DataSource, "Export.docx", false, false, "flat-saffron");
        }
        protected void EmployeesGrid_ServerWordExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)
        {
            WordExport     exp  = new WordExport();
            GridProperties obj  = ConvertGridObject(e.Arguments["model"].ToString());
            GridWordExport exp1 = new GridWordExport()
            {
                IsTemplateColumnIncluded = true, IsHideColumnIncude = false, Theme = "flat-lime", FileName = "Export.docx"
            };

            exp.Export(obj, (IEnumerable)EmployeesGrid.DataSource, exp1);
        }
示例#10
0
        public void ExportToWordAlbum(string GridModel)
        {
            WordExport exp        = new WordExport();
            var        DataSource = context.Albums.ToList();
            //GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);
            GridProperties obj = ConvertGridObject(GridModel);

            obj.Columns[2].DataSource = context.Artistas.ToList();
            obj.Columns[3].DataSource = context.Generoes.ToList();
            exp.Export(obj, DataSource, "WordAlbum.docx", false, false, "flat-saffron");
        }
        public void WordEmpleado(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = context.Empleados.ToList();
            GridProperties obj        = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel);

            obj.Columns[5].DataSource  = context.Departamentos.ToList();
            obj.Columns[12].DataSource = context.Sexo.ToList();
            obj.Columns[13].DataSource = context.EstadoCivil.ToList();
            exp.Export(obj, DataSource, "Empleados.docx", false, false, "default-theme");
        }
        public void ExportHierarchyToWord(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = new NorthwindDataContext().EmployeeViews.ToList();
            GridProperties obj        = ConvertGridObject(GridModel);

            obj.ChildGrid.DataSource = new NorthwindDataContext().OrdersViews.Take(100).ToList();
            GridWordExport expo = new GridWordExport();

            expo.IncludeChildGrid = true;
            exp.Export(obj, DataSource, expo);
        }
示例#13
0
        public ActionResult HierarchyExportToWord(string GridModel)
        {
            WordExport     exp        = new WordExport();
            var            DataSource = emp;
            GridProperties gridProp   = ConvertGridModel(GridModel);

            gridProp.ChildGrid.DataSource = _context.Orders.Take(100).ToList();
            GridWordExport wrdExp = new GridWordExport();

            wrdExp.FileName         = "Export.docx"; wrdExp.Theme = "flat-saffron";
            wrdExp.IncludeChildGrid = true;
            return(exp.Export(gridProp, DataSource, wrdExp));
        }
示例#14
0
        public void MultipleExportToWord(string[] GridModel)
        {
            WordExport    exp          = new WordExport();
            var           EmployeeData = new NorthwindDataContext().EmployeeViews.Take(5).ToList();
            var           OrderData    = new NorthwindDataContext().OrdersViews.Take(5).ToList();
            IWordDocument document     = null;
            bool          initial      = true;;

            foreach (string gridProperty in GridModel)
            {
                GridProperties gridProp = ConvertObject(gridProperty);
                if (initial)
                {
                    gridProp.Locale = "";
                    document        = exp.Export(gridProp, EmployeeData, "Export.docx", true, true, "flat-saffron", true);
                    initial         = false;
                }
                else
                {
                    exp.Export(gridProp, OrderData, "Export.docx", true, true, "flat-saffron", false, document, "Second Grid");
                }
            }
        }
示例#15
0
        public ActionResult ExportToWord(string GridModel)
        {
            WordExport exp        = new WordExport();
            var        DataSource = _context.Clients
                                    .Include(c => c.Country)
                                    .Include(o => o.Occupation).Take(100).ToList();
            GridProperties gridProp = ConvertGridObject(GridModel);
            GridWordExport wrdExp   = new GridWordExport
            {
                FileName = "Export.docx",
                Theme    = "flat-saffron"
            };

            return(exp.Export(gridProp, DataSource, wrdExp));
        }
示例#16
0
        private void ButtonExport_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var fileName = $"Рассчет от {DateTime.Now:U}.doc".Replace(':', '.');
                var export   = new WordExport(fileName);
                export.Export(MainWindowViewModel.Instance.Calculation.CalculationResult);

                var mess = new MessageBoxWindow($"Расчет ({fileName}) сформирован на рабочем столе");
                mess.ShowDialog();
            }
            catch (Exception exception)
            {
                var mess = new MessageBoxWindow(exception.Message);
                mess.ShowDialog();
            }
        }