コード例 #1
0
ファイル: Reportsview.cs プロジェクト: truongvncj/Maketting
        private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
        {
            // MessageBox.Show("In payment request !");

            //string connection_string = Utils.getConnectionstr();

            //LinqtoSQLDataContext dc = new LinqtoSQLDataContext(connection_string);
            //var rschangepritcheck = from tbl_kacontractsdetailpayment in dc.tbl_kacontractsdetailpayments
            //                        where tbl_kacontractsdetailpayment.BatchNo == BatchNo// &&  tbl_kacontractsdatadetail.ContractNo == contractno
            //                        select tbl_kacontractsdetailpayment;


            //if (rschangepritcheck != null)
            //{
            //    foreach (var item in rschangepritcheck)
            //    {
            //        item.PrintChk = true;
            //        item.PrintDate = DateTime.Today;
            //  //      item.
            //        dc.SubmitChanges();
            //   //     this.formcreatCtract.loadDetailContractView(contractno);
            //    }
            //}


            //      this.Close();
        }
コード例 #2
0
 private void reportViewer1_Print(object sender, ReportPrintEventArgs e)
 {
     e.PrinterSettings.DefaultPageSettings.Margins.Right  = 0;
     e.PrinterSettings.DefaultPageSettings.Margins.Left   = 0;
     e.PrinterSettings.DefaultPageSettings.Margins.Top    = 0;
     e.PrinterSettings.DefaultPageSettings.Margins.Bottom = 0;
 }
コード例 #3
0
ファイル: Frm_tag_print.cs プロジェクト: mtdk/MTsystem_win
        private void tagPrint_reportview_PrintingBegin(object sender, ReportPrintEventArgs e)
        {
            MySqlConnection conn = new MySqlConnection(connectstr.CONNECTSTR);

            conn.Open();
            MySqlTransaction transaction = conn.BeginTransaction();

            try
            {
                string       strsql = "UPDATE tag_print SET print_status = @print_status WHERE id = @id";
                MySqlCommand cmd    = new MySqlCommand();
                cmd.Connection  = conn;
                cmd.CommandText = strsql;
                cmd.Parameters.AddWithValue("@print_status", "已打印");
                cmd.Parameters.AddWithValue("@id", Convert.ToInt16(printid.Trim()));
                cmd.ExecuteNonQuery();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("错误代码:" + ex.Number + "这条信息仍然能被打印,但数据状态无法被更新,请尽快与管理员联系!\n错误信息:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                transaction.Rollback();
                conn.Close();
            }
            finally
            {
                if (conn.State != ConnectionState.Closed)
                {
                    transaction.Commit();
                    conn.Close();
                }
            }
        }
コード例 #4
0
 private void rptViewer_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     if (ter.UpdateDispatchStatus(this.id, 1) <= 0)
     {
         MessageBox.Show("Dispatch Status not updated...?", "Dispatch Status", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.Close();
     }
 }
コード例 #5
0
        private void rvwCotizacion_PrintingBegin(object sender, ReportPrintEventArgs e)
        {
            string impresora      = e.PrinterSettings.PrinterName;
            int    dePagina       = e.PrinterSettings.FromPage;
            int    hastaPagina    = e.PrinterSettings.ToPage;
            int    cantidadCopias = e.PrinterSettings.Copies;

            GeneracionCotizacion("IMPRIMIR", null, null, null, null, impresora, dePagina, hastaPagina, cantidadCopias);
        }
コード例 #6
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void rp_Print(object sender, ReportPrintEventArgs e)
        {
            ReportViewer    reportViewer = sender as ReportViewer;
            PrinterSettings setting      = new PrinterSettings();

            setting.PrintRange = PrintRange.SomePages;
            setting.FromPage   = reportViewer.CurrentPage;
            setting.ToPage     = reportViewer.CurrentPage;
            e.PrinterSettings  = setting;
        }
コード例 #7
0
 private void reportViewer_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     try
     {
         reportViewer.PrinterSettings.PrinterName = e.PrinterSettings.PrinterName;
         reportViewer.PrinterSettings.FromPage    = e.PrinterSettings.FromPage;
         reportViewer.PrinterSettings.ToPage      = e.PrinterSettings.ToPage;
     }
     catch (Exception ex)
     {
         Helper.MensajeError(ex.Message, GlobalClass.NombreApp);
     }
 }
コード例 #8
0
ファイル: frmReport.cs プロジェクト: darkholds/mcs_pams
 private void rvReport_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     if (ReportType == ReportTypes.OR)
     {
         ((Receipt)report).PrintReport();
     }
     else if (ReportType == ReportTypes.OFOR)
     {
         ((OFReceipt)report).PrintReport();
     }
     else if (ReportType == ReportTypes.PTAOR)
     {
         ((PTAReceipt)report).PrintReport();
     }
 }
コード例 #9
0
        private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
        {
            try
            {
                if (PrintBatch_CB.Checked == true)
                {
                    System.Drawing.Printing.PrinterSettings _PrinterSettings = new System.Drawing.Printing.PrinterSettings();
                    _PrinterSettings.PrinterName = Variables.PrinterName;
                    reportViewer1.PrintDialog(_PrinterSettings);

                    if (BillDataGridView.SelectedRows.Count > 0)
                    {
                        BillNumberSearch_txt.Text = BillDataGridView.SelectedRows[0].Cells["ID"].Value.ToString();
                        BillDataGridView.SelectedRows[0].Selected = false;
                        Variables.NotificationMessageTitle        = this.Name;
                        Variables.NotificationMessageText         = BillDataGridView.SelectedRows.Count.ToString();
                        Variables.NotificationStatus = true;
                    }
                }
            }
            catch (Exception ex)
            { }
        }
コード例 #10
0
        private void reportViewerTheKho_Print(object sender, ReportPrintEventArgs e)
        {
            var ps = e.PrinterSettings; //printDialog1.PrinterSettings;

            var sb = new StringBuilder(1024);
            var xr = System.Xml.XmlWriter.Create(sb);
            xr.WriteStartElement("DeviceInfo");
            xr.WriteElementString("OutputFormat", "EMF");
            //This is only an estimate
            _PrintingPageCount = reportViewerTheKho.LocalReport.GetTotalPages();

            //Ensure EMF is recorded on a bitmap with the same resolution as the printer
            _PrintingDPI.X = ps.DefaultPageSettings.PrinterResolution.X;
            _PrintingDPI.Y = ps.DefaultPageSettings.PrinterResolution.Y;

            xr.WriteElementString("PrintDpiX", _PrintingDPI.X.ToString());
            xr.WriteElementString("PrintDpiY", _PrintingDPI.Y.ToString());

            xr.Close();

            //Estimate list capacity
            _PrintingStreams = new List<Stream>(_PrintingPageCount);

            //Render using the callback API
            Warning[] warnings;
            reportViewerTheKho.LocalReport.Render("Image",
                      sb.ToString(), lr_CreateStream, out warnings);

            //Reset all streams to the beginning
            foreach (var s in _PrintingStreams) s.Position = 0;

            e.PrinterSettings = ps;

            e.Cancel = true;

            //And print the document as normal
            var pd = new PrintDocument();

            pd.PrinterSettings = e.PrinterSettings;//ps;
            pd.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);

            pd.PrintPage += pd_PrintPage;
            pd.EndPrint += pd_EndPrint;

            //pd.Print();
            PrintDialog printDialog = new PrintDialog();
            printDialog.Document = pd;

            if (printDialog.ShowDialog() == DialogResult.OK)
            {
                pd.Print();
            }
            else
            {
                MessageBox.Show("Print Cancelled");
            }
        }
コード例 #11
0
 void ReportViewer_Print(object sender, ReportPrintEventArgs e)
 {
     var xx = sender;
 }
コード例 #12
0
ファイル: VisorDeReportes.cs プロジェクト: moisesiq/aupaga
 private void reportViewer_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     try
     {
         reportViewer.PrinterSettings.PrinterName = e.PrinterSettings.PrinterName;
         reportViewer.PrinterSettings.FromPage = e.PrinterSettings.FromPage;
         reportViewer.PrinterSettings.ToPage = e.PrinterSettings.ToPage;
     }
     catch (Exception ex)
     {
         Helper.MensajeError(ex.Message, GlobalClass.NombreApp);
     }
 }
コード例 #13
0
 private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     this.reportViewer1.LocalReport.SetParameters(new ReportParameter("HideBg", "True", true));
     this.printing = true;
 }
コード例 #14
0
 private void reportViewer1_Print(object sender, ReportPrintEventArgs e)
 {
     Print();
 }
コード例 #15
0
ファイル: ViewerReciboSemanal.cs プロジェクト: tonfranco/LR
 private void reportViewer1_Print(object sender, ReportPrintEventArgs e)
 {
     this.Close();
 }
コード例 #16
0
        private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
        {
            try
            {
                if (PrintBatch_CB.Checked == true)
                {
                    System.Drawing.Printing.PrinterSettings _PrinterSettings = new System.Drawing.Printing.PrinterSettings();
                    _PrinterSettings.PrinterName = Variables.PrinterName;
                    reportViewer1.PrintDialog(_PrinterSettings);

                    if (BillDataGridView.SelectedRows.Count > 0)
                    {
                        BillNumberSearch_txt.Text = BillDataGridView.SelectedRows[0].Cells["ID"].Value.ToString();
                        BillDataGridView.SelectedRows[0].Selected = false;
                        Variables.NotificationMessageTitle = this.Name;
                        Variables.NotificationMessageText = BillDataGridView.SelectedRows.Count.ToString();
                        Variables.NotificationStatus = true;
                    }
                }
            }
            catch (Exception ex)
            { }
        }
コード例 #17
0
 private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     e.PrinterSettings.DefaultPageSettings.Landscape = false;
 }
コード例 #18
0
 private void rptViewer_Print(object sender, ReportPrintEventArgs e)
 {
     //MessageBox.Show("print button");
 }
コード例 #19
0
 private void reportViewer1_SendPrintInfo(object sender, ReportPrintEventArgs e)
 {
     notifyIcon1.ShowBalloonTip(5, "Information", "Utskriften har skickats till skrivaren.", ToolTipIcon.Info);
     WindowState = FormWindowState.Minimized;
 }
コード例 #20
0
 private void ReportViewer1_Print(object sender, ReportPrintEventArgs e)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
 private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     Close();
 }
コード例 #22
0
 private void reportViewer1_PrintingBegin(object sender, ReportPrintEventArgs e)
 {
     // MessageBox.Show("se imprimio");
 }