示例#1
0
        private void barPrintPPE_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tag = 2;
            bool canSave = (DialogResult.OK == MessageBox.Show("是否將打印文件上傳至服務器(pdf格式)", "操作提示", MessageBoxButtons.OKCancel));
            RO   r       = new RO(this._pcExpANSI, tag);

            //r.ShowPreviewDialog();
            if (canSave)
            {
                if (this._pcExpANSI != null && !string.IsNullOrEmpty(this._pcExpANSI.ExportReportId))
                {
                    string sfdir = this._ServerSavePath + "\\" + this._pcExpANSI.ExportReportId;
                    try
                    {
                        System.IO.Directory.CreateDirectory(sfdir);
                        r.ExportToPdf(sfdir + "\\" + this._pcExpANSI.ExportReportId + ".pdf");
                        MessageBox.Show("文件已導出為pdf格式上傳至服務器");
                    }
                    catch (Exception ex) { MessageBox.Show(ex.ToString()); }
                }
            }
            r.ShowPreviewDialog();
        }
示例#2
0
        //列印
        protected override DevExpress.XtraReports.UI.XtraReport GetReport()
        {
            tag = 0;
            bool canSave = (DialogResult.OK == MessageBox.Show("是否將打印文件上傳至服務器(pdf格式)", "操作提示", MessageBoxButtons.OKCancel));
            RO   r       = new RO(this._pcExpANSI, tag);

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