Beispiel #1
0
        private void simpleButton8_Click_1(object sender, EventArgs e)
        {
            WordExport w      = new WordExport();
            DateTime   datebc = date_ngaybaocao.Value;

            w.BaoCaoDoanhThu(datebc.Day.ToString(), datebc.Month.ToString(), datebc.Year.ToString(), "Báo cáo doanh thu", txt_hotenbaocao.Text, txt_chinhanhbaocao.Text, datebc.ToString(), txt_doanhthubaocao.Text, txt_giamgiabaocao.Text, txt_giôcngbaocao.Text, txt_sodienbaocao.Text, txt_sonuocbaocao.Text);
        }
Beispiel #2
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");
    }
        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");
        }
Beispiel #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);
        }
Beispiel #6
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 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");
        }
Beispiel #8
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));
        }
Beispiel #9
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");
        }
        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");
        }
Beispiel #11
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");
        }
        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);
        }
        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);
        }
Beispiel #14
0
        private void CreateOpenXmlReport_Click(object sender, EventArgs e)
        {
            var selectedNode = MainView.SelectedNode;

            if (selectedNode == null)
            {
                MessageBox.Show("Ни один компонент не выбран.", "Ошибка");
                return;
            }

            WordExport.ExportOpenXmlReport(selectedNode);
        }
Beispiel #15
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));
        }
Beispiel #16
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));
        }
Beispiel #17
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainForm     mainForm    = new MainForm();
            IWordExport  wordExport  = new WordExport();
            IExcelExport excelExport = new ExcelExport();

            // Регистрация делегатов
            MainForm.Export exportText = wordExport.Export;
            exportText += excelExport.Export;
            exportText += wordExport.ExportDotx;
            mainForm.RegisterExportDelegate(exportText);

            Application.Run(mainForm);
        }
Beispiel #18
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();
            }
        }
Beispiel #19
0
        private void ShowSaveAsFileDialog(string filter)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            {
                sfd.RestoreDirectory = true;
                sfd.FilterIndex      = 1;

                if (filter == "xml")
                {
                    //sfd.InitialDirectory = Directory.GetCurrentDirectory();
                    sfd.DefaultExt = ".xml";
                    sfd.Filter     = "XML files (*.xml)|*.xml|All files (*.*)|*.*";
                    sfd.Title      = "Save file as XML.";
                }
                else if (filter == "doc")
                {
                    sfd.DefaultExt = "*.doc";
                    sfd.Filter     = "Doc files (*.doc)|*.doc|All files (*.*)|*.*";
                    sfd.Title      = "Save file as Word.";
                }
            };

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                filePath              = sfd.FileName;
                previousPath          = Path.GetDirectoryName(sfd.FileName);
                lastFullNameandFolder = previousPath + "\\" + Path.GetFileName(sfd.FileName);

                if (filter == "xml")
                {
                    XMLWrite xwWrite = new XMLWrite(filePath, sysData, columnMaterial, geoTex, soilList);
                }
                else if (filter == "doc")
                {
                    WordExport doc = new WordExport(filePath, richTxtResults.Rtf);
                }

                MessageBox.Show("File saved as " + filePath, "File saved.", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #20
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");
                }
            }
        }