public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CRKardex4 rpt = new CRKardex4(); rpt.Site = this.Site; return(rpt); }
private void btnReporte_Click(object sender, EventArgs e) { //CRKardex rpt = new CRKardex(); //frmRptKardex frm = new frmRptKardex(); //rpt.SetDataSource(ds.kardex(dtpFecha1.Value, dtpFecha2.Value,pro.CodProducto,frmLogin.iCodAlmacen).Tables[0]); //frm.crvKardex.ReportSource = rpt; //frm.Show(); CRKardex4 rpt1 = new CRKardex4(); frmRptKardex frm = new frmRptKardex(); DataTable nuevo = new DataTable(); try { if (rbArt.Checked) { if (txtUnArt.Text != "") { nuevo = ds.kardex4(dtpFecha1.Value, dtpFecha2.Value, rbTodosArt.Checked, txtUnArt.Text, frmLogin.iCodAlmacen).Tables[0]; rpt1.SetDataSource(nuevo); frm.crvKardex.ReportSource = rpt1; frm.Show(); } else { MessageBox.Show("Debe elegir un producto"); } } if (rbTodosArt.Checked) { nuevo = ds.kardex4(dtpFecha1.Value, dtpFecha2.Value, rbTodosArt.Checked, txtUnArt.Text, frmLogin.iCodAlmacen).Tables[0]; rpt1.SetDataSource(nuevo); frm.crvKardex.ReportSource = rpt1; frm.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }