Ejemplo n.º 1
0
        //列印
        protected override DevExpress.XtraReports.UI.XtraReport GetReport()
        {
            tag = 0;
            bool canSave = (DialogResult.OK == MessageBox.Show("是否將打印文件上傳至服務器(pdf格式)", "操作提示", MessageBoxButtons.OKCancel));
            //原来是分开两张打印,现在合并一张
            //JISRO r = new JISRO(this._PCExportReportANSI, tag);
            //JISRO2 r2 = new JISRO2(this._PCExportReportANSI, tag);
            ////r.ShowPreviewDialog();
            //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();

            JISRO1 r = new JISRO1(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();


            return(null);
        }
Ejemplo n.º 2
0
        private void barPrintALAN_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tag = 1;
            bool canSave = (DialogResult.OK == MessageBox.Show("是否將打印文件上傳至服務器(pdf格式)", "操作提示", MessageBoxButtons.OKCancel));
            //JISRO r = new JISRO(this._PCExportReportANSI, tag);
            //JISRO2 r2 = new JISRO2(this._PCExportReportANSI, tag);
            ////r.ShowPreviewDialog();
            //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();

            JISRO1 r = new JISRO1(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();
        }