コード例 #1
0
        static void MenuExportXlsxClick(object sender, EventArgs e)
        {
            string fileName = "list" + DateTime.Now.ToString("yyMMddHHmmss") + ".xlsx";
            var    dir      = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "wfdocuments");

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            fileName = Path.Combine(dir, fileName);
            var export = new XlsxSaxExport();

            export.Export(fileName, LayoutList.DefaultMenu.ContextList);
            System.Diagnostics.Process.Start(fileName);
        }
コード例 #2
0
ファイル: QueryResultView.cs プロジェクト: radtek/datawf
        protected virtual void ToolExportClick(object sender, EventArgs e)
        {
            string fileName = "list" + DateTime.Now.ToString("yyMMddHHmmss") + ".xlsx";

            using (var dialog = new SaveFileDialog()
            {
                InitialFileName = fileName
            })
            {
                if (dialog.Run(ParentWindow))
                {
                    XlsxSaxExport export = new XlsxSaxExport();
                    export.Export(dialog.FileName, list);
                    System.Diagnostics.Process.Start(dialog.FileName);
                }
            }
        }