Пример #1
0
 /// <summary>
 /// 其他数据导出
 /// </summary>
 /// <param name="paramGridView">要操作的GridView控件</param>
 /// <param name="paramFilePath">导出文件路径</param>
 private static void ExportToTXT(DevExpress.XtraGrid.Views.Grid.GridView paramGridView, string paramFilePath)
 {
     DevExpress.XtraPrinting.TextExportOptions myTextExportOptions = new DevExpress.XtraPrinting.TextExportOptions();
     myTextExportOptions.QuoteStringsWithSeparators = true;
     myTextExportOptions.TextExportMode             = DevExpress.XtraPrinting.TextExportMode.Text;
     paramGridView.ExportToText(paramFilePath, myTextExportOptions);
 }
        //
        // TXT 화일변환
        //
        //-------------------------------------------------------------------------------------------------------------
        private void simpleTXT_Click(object sender, EventArgs e)
        {
            String fileName = ShowSaveFileDialog("Text Document", "Text Files|*.txt");

            if (fileName != "")
            {
                gridView1.ExportToText(fileName);
                OpenFile(fileName);
            }
        }
Пример #3
0
        private void btnTextExport_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.GridView view = grdCtrEkstre.MainView as DevExpress.XtraGrid.Views.Grid.GridView;
            if (view != null)
            {
                view.ExportToText("StokEkstre.txt");
            }


            Process pdfExport = new Process();

            pdfExport.StartInfo.FileName  = "notepad.exe";
            pdfExport.StartInfo.Arguments = "StokEkstre.txt";
            pdfExport.Start();
        }