コード例 #1
0
ファイル: JISEditForm.cs プロジェクト: daobataotie/Mobe
        private void barPrintJingPianPinZhi_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tag = 3;
            bool   canSave = (DialogResult.OK == MessageBox.Show("是否將打印文件上傳至服務器(pdf格式)", "操作提示", MessageBoxButtons.OKCancel));
            JISRO  r       = new JISRO(this._PCExportReportANSI, tag);
            JISRO2 r2      = new JISRO2(this._PCExportReportANSI, tag);

            if (canSave)
            {
                if (this._PCExportReportANSI != null && !string.IsNullOrEmpty(this._PCExportReportANSI.ExportReportId))
                {
                    string sfdir = this._ServerSavePath + "\\" + this._PCExportReportANSI.ExportReportId;
                    try
                    {
                        System.IO.Directory.CreateDirectory(sfdir);
                        r.ExportToPdf(sfdir + "\\" + this._PCExportReportANSI.ExportReportId + ".pdf");
                        MessageBox.Show("文件已導出為pdf格式上傳至服務器");
                    }
                    catch (Exception ex) { MessageBox.Show(ex.ToString()); }
                }
            }
            r.ShowPreview();
            r2.ShowPreview();
        }