Esempio n. 1
0
        private void reportViewer1_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
        {
            this.reportViewer1.PrintDialog();

            string testRunNo = this.ReportDataSet.GetHeaderInfoByUUTID.Where(id => id.NAME == "TestRunString").FirstOrDefault().DATA;

            //testRunNo.Substring(0, 8);
            testRunNo  = testRunNo.TrimEnd('x');
            testRunNo += _UUTID.ToString();
            SavePDF(this.reportViewer1, @"C:\TEMP\" + testRunNo.Replace("/", "-") + ".pdf");
        }
Esempio n. 2
0
 void reportViewer1_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
 {
     //Caso colocasse juntamente com o Load, o report iria aparecer como 'was canceled' e não iria aparecer o carregamento do report.
     if (this.firstTime)
     {
         this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
         this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
         this.reportViewer1.ZoomPercent = 100;
         this.firstTime = false;
     }
 }
Esempio n. 3
0
 private void reportViewer_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
 {
 }
Esempio n. 4
0
        /// <summary>
        /// ReportViewer渲染完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReportView_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
        {
            if (e.Exception != null)
            {
                var exp = e.Exception;
                while (exp.InnerException != null)
                {
                    exp = exp.InnerException;
                }
                XMessageBox.Error(string.Format("无法打印:{0}", exp.Message));
                return;
            }

            ReportViewer rv = sender as ReportViewer;

            //rv.SetPageSettings(Config.GetPageSettings());
            #region 如果能直接打印了

            if (!PrintData.PrintTemplate.IsAppend || CanPrint != null && CanPrint.Value)
            {
                if (e.Exception == null && rv.LocalReport.DataSources.Count > 0)
                {
                    try
                    {
                        Export(rv.LocalReport);
                        printDocument1.DefaultPageSettings = Config.GetPageSettings();
                        printDocument1.PrinterSettings     = Config.GetPrintSettings();
                        printDocument1.Print();
                        StreamDispose();
                    }
                    catch (Exception exp)
                    {
                        XMessageBox.Warning(string.Format("无法打印:{0}", exp.Message));
                        //XMessageBox.Warning(string.Format("无法打印:{0}", exp.Message));
                    }
                }

                return;
            }

            #endregion

            #region 往页后面追加行
            if (PrintData.PrintTemplate.IsAppend)
            {
                var totalPages = rv.GetTotalPages();

                if (LastPageCount == null)
                {
                    LastPageCount = totalPages;
                }
                var dt = rv.LocalReport.DataSources[0].Value as DataTable;
                if (LastPageCount == totalPages)
                {
                    dt.Rows.Add(dt.NewRow());
                }
                else
                {
                    dt.Rows.RemoveAt(dt.Rows.Count - 1);
                    CanPrint = true;
                }
                rv.RefreshReport();
                return;
            }


            #endregion
        }
Esempio n. 5
0
 private void PrescriptionReportViewer_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
 {
     //maskLayer.Visibility = Visibility.Collapsed;
 }