public static void Print_Queue(BOL.Transaction_Queue.objTransactionQueue trans_queue) { BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, arg) => { try { rptQueueTicket report = new rptQueueTicket(trans_queue) { Name = "Queue Ticket" }; ReportSource report_source = new InstanceReportSource() { ReportDocument = report }; // Obtain the settings of the default printer System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); // The standard print controller comes with no UI System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController(); // Print the report using the custom print controller Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); reportProcessor.PrintController = standardPrintController; //reportProcessor.PrintReport(typeReportSource, printerSettings); reportProcessor.PrintReport(report_source, printerSettings); } catch (Exception ex) { EventLog.WriteEntry("Report", ex.Message, EventLogEntryType.Error); } }; //bw.RunWorkerCompleted += (s, arg) => //{ // if (arg.Error == null) // { // } // else // throw new Exception(arg.Error.Message); //}; bw.RunWorkerAsync(); }
public void Window_Loaded(object sender, RoutedEventArgs e) { this.Hide(); RptPagare report = new RptPagare(UsarFolio, UsarCantidad, UsarFecha, UsarCantLetra, UsarNumPagare, UsarNumPagares, UsarNombre, UsarDireccion, UsarColonia, UsarCiudad, UsarEstado); ReportViewer.Report = report; ReportViewer.RefreshReport(); //-------Que muestra previsualizador de que se esta imprimiendo //System.Drawing.Printing.PrinterSettings printerSettings // = new System.Drawing.Printing.PrinterSettings(); //Telerik.Reporting.Processing.ReportProcessor reportProcessor // = new Telerik.Reporting.Processing.ReportProcessor(); //Telerik.Reporting.TypeReportSource typeReportSource = // new Telerik.Reporting.TypeReportSource(); //reportProcessor.PrintReport(report, printerSettings); // ------------codigo // Obtain the settings of the default printer System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); //--------- The standard print controller comes with no UI----------// System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController(); // Print the report using the custom print controller Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); reportProcessor.PrintController = standardPrintController; Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource(); reportProcessor.PrintReport(report, printerSettings); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { try { System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); // The standard print controller comes with no UI System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController(); // Print the report using the custom print controller Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); //reportProcessor.PrintController = standardPrintController; //reportProcessor.PrintReport(ViewRptSumario.Report, printerSettings); Hashtable deviceInfo = new Hashtable(); deviceInfo.Add("ImmediatePrint", true); reportProcessor.RenderReport("PDF", ViewRptSumario.Report, deviceInfo); reportProcessor.PrintReport(ViewRptSumario.Report, printerSettings); //if (m_fDataAlta) //{ // //Atualiza Data Impressão // m_oSumario.DATA_IMPRESSAO_SUMARIO = Convert.ToDateTime(DateTime.Now); // m_oSumario.SalvarSumario_Impressao(Convert.ToInt32(UtSessao.Sessao["Id058"])); // UtSessao.Sessao["Habilita"] = "N"; // ExibirMensagemPopUp("Sumário de Alta foi Fechado com sucesso!!!"); //} //else //{ // ExibirMensagemPopUp("Data da Alta - não informada!!!"); //} } catch (Exception ex) { ExibirMensagemPopUp(ex.Message); } if (UtSessao.Sessao["Habilita"].ToString() == "S") { if (m_fDataAlta) { //Atualiza Data Impressão m_oSumario.DATA_IMPRESSAO_SUMARIO = Convert.ToDateTime(DateTime.Now); m_oSumario.SalvarSumario_Impressao(Convert.ToInt32(UtSessao.Sessao["Id058"])); UtSessao.Sessao["Habilita"] = "N"; ExibirMensagemPopUp("Sumário de Alta foi Fechado com sucesso!!!"); } else { ExibirMensagemPopUp("Data da Alta - não informada!!!"); } } }