private void btn_Print(object sender, EventArgs e) { if (dgvDatos.Rows.Count <= 0) { return; } string path = string.Empty; if (rb4.Checked) { path = @"\\192.168.2.100\HalcoNET\Crystal\rpt_marbete_4.rpt"; } if (rb10.Checked) { path = @"\\192.168.2.100\HalcoNET\Crystal\rpt_marbete_10.rpt"; } string itms = string.Empty; foreach (UltraGridRow item in dgvDatos.Rows) { itms += "'" + item.Cells["ItemCode"].Value + "',"; } Constantes.Clases.LoadRPT rpt = new Constantes.Clases.LoadRPT(path); Constantes.frmVisor form = new Constantes.frmVisor(rpt.DocRPT); rpt.SetParameter(itms.Trim(',')); form.MdiParent = this.MdiParent; form.Show(); }
private void dgvEntregas_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { if (e.Cell.Row.Index > -1 && e.Cell.Band.Index == 0) { if (e.Cell.Column.Header.Caption == "") { Constantes.Clases.LoadRPT rpt = new Constantes.Clases.LoadRPT(20011); Constantes.frmVisor form = new Constantes.frmVisor(rpt.DocRPT); //rpt.GenerarPDF(dgvEntregas.Rows[e.Cell.Row.Index].Cells["DocEntry"].Value.ToString()); rpt.Print(dgvEntregas.Rows[e.Cell.Row.Index].Cells["DocEntry"].Value.ToString()); //form.Show(); } } }
private void btnPrint_Click(object sender, EventArgs e) { //string dsXML = (dgvDatos.DataSource as DataSet).GetXml(); DataSet ds = (dgvDatos.DataSource as DataSet); //using (System.IO.StreamWriter fs = new System.IO.StreamWriter("c:\\pp\\datos.xml")) // XML File Path //{ // (dgvDatos.DataSource as DataSet).WriteXml(fs); //} Constantes.frmVisor form = new Constantes.frmVisor(ds, @"\\192.168.2.100\HalcoNET\Crystal\rptInformeAuditoriaStocks.rpt"); form.MdiParent = this.MdiParent; form.Show(); }
private void btnImprimir_Click(object sender, EventArgs e) { try { if (!typeDocument.Equals("OC")) { this.SetMensaje("Imposible crear versiĆ³n impresa.", 5000, Color.Red, Color.White); return; } Constantes.Clases.LoadRPT rpt = new Constantes.Clases.LoadRPT(IdDocument); Constantes.frmVisor form = new Constantes.frmVisor(rpt.DocRPT); rpt.GenerarPDF(DocumentSAP.DocEntry.ToString()); form.MdiParent = this.MdiParent; form.Show(); } catch (Exception ex) { this.SetMensaje(ex.Message, 5000, Color.Red, Color.White); } // System.Diagnostics.Process.Start(rpt.GenerarPDF(Document.DocEntry.ToString())); }