private void MetroWindow_Loaded(object sender, RoutedEventArgs e) { try { _invoiceData = new ArrayList(); _invoiceDataSummary = new ArrayList(); //String varNumGuia = _invHdrVM.updateNumeroGuia(_co, _idv_invoice, _user._usn_pon_pos_id); this.LoadDataInvoiceReport(); this.LoadDataInvoiceReport_Summary(); ReportGuiaRem report = new ReportGuiaRem(); //////ReportInvoice report = new ReportInvoice(); //report.SetDataSource(_invoiceData); report.Database.Tables[0].SetDataSource(_invoiceData); report.Database.Tables[1].SetDataSource(_invoiceDataSummary); /*impresion directa y cerrar el frm despues de imprimir*/ crReportInvoiceGuia.ViewerCore.ReportSource = report; report.PrintToPrinter(1, false, 0, 0); this.Close(); } catch (Exception ex) { MessageBox.Show("Error en la generacion del reporte, detalle :" + ex.Message.ToString(), Ent_Msg.msginfomacion, MessageBoxButton.OK, MessageBoxImage.Error); } }
public void ImpresionD(string VenId, string TiendaId) { try { _invoiceData = new ArrayList(); _invoiceDataSummary = new ArrayList(); //String varNumGuia = _invHdrVM.updateNumeroGuia(_co, _idv_invoice, _user._usn_pon_pos_id); LoadDataInvoiceReport(VenId, TiendaId); LoadDataInvoiceReport_Summary(); ReportGuiaRem report = new ReportGuiaRem(); report.Database.Tables[0].SetDataSource(_invoiceData); report.Database.Tables[1].SetDataSource(_invoiceDataSummary); //IMPRESION DIRECTA report.PrintToPrinter(1, false, 0, 0); Dat_Venta.valida_token_reimpresion(2, "", ""); //actualiza el flag del ultimo token } catch (Exception ex) { MessageBox.Show("Error en la generacion del reporte, detalle :" + ex.Message.ToString(), Ent_Msg.msginfomacion, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void button_Click(object sender, RoutedEventArgs e) { //ReportGuiaRem objguia_reporte = new ReportGuiaRem(); //objguia_reporte.PrintToPrinter(1, false, 0, 0); try { _invoiceData = new ArrayList(); _invoiceDataSummary = new ArrayList(); this.LoadDataInvoiceReport(); this.LoadDataInvoiceReport_Summary(); ReportGuiaRem report = new ReportGuiaRem(); report.Database.Tables[0].SetDataSource(_invoiceData); report.Database.Tables[1].SetDataSource(_invoiceDataSummary); //crReportInvoiceGuia.ViewerCore.ReportSource = report; //report.PrintToPrinter(1, false, 0, 0); this.Close(); } catch (Exception ex) { MessageBox.Show("Error en la generacion del reporte, detalle :" + ex.Message.ToString(), Ent_Msg.msginfomacion, MessageBoxButton.OK, MessageBoxImage.Error); } }