//-------------------------------------------------------------------------------------------------------------------------------------------------- public void generoFactura(int NroFac) { _vrf.obtengoNroFac.Text = NroFac.ToString(); var result = System.Windows.Forms.MessageBox.Show("DESEA ABRIR FACTURA DE CLIENTE?", "REIMPRESION FACTURA", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result == DialogResult.OK) { facturaReporteForm fcr = new facturaReporteForm(); ParameterField pf = new ParameterField(); ParameterFields pfs = new ParameterFields(); ParameterDiscreteValue pdv = new ParameterDiscreteValue(); pf.Name = "@Nro_Fac"; pdv.Value = NroFac; pf.CurrentValues.Add(pdv); pfs.Add(pf); fcr.crystalReport.ParameterFieldInfo = pfs; PATHReport = Environment.CurrentDirectory + @"\Factura.rpt"; oRep.Load(PATHReport); fcr.crystalReport.ReportSource = oRep; fcr.ShowDialog(); } }
//-------------------------------------------------------------------------------------------------------------------------------------------------- public void generoFactura(int NroFac, string nt, string iv, string ivaImp) { facturaReporteForm fcr = new facturaReporteForm(); ParameterField pf = new ParameterField(); ParameterFields pfs = new ParameterFields(); ParameterDiscreteValue pdv = new ParameterDiscreteValue(); pf.Name = "@Nro_Fac"; pdv.Value = NroFac; pf.CurrentValues.Add(pdv); pfs.Add(pf); fcr.crystalReport.ParameterFieldInfo = pfs; PATHReport = Environment.CurrentDirectory + @"\Factura.rpt"; oRep.Load(PATHReport); TextObject neto; TextObject IVA; TextObject ivaImpuesto; if (oRep.ReportDefinition.ReportObjects["neto"] != null) { neto = (TextObject)oRep.ReportDefinition.ReportObjects["neto"]; neto.Text = nt; } if (oRep.ReportDefinition.ReportObjects["iva"] != null) { IVA = (TextObject)oRep.ReportDefinition.ReportObjects["iva"]; IVA.Text = iv; } if (oRep.ReportDefinition.ReportObjects["IVAImp"] != null) { ivaImpuesto = (TextObject)oRep.ReportDefinition.ReportObjects["IVAImp"]; ivaImpuesto.Text = ivaImp; } fcr.crystalReport.ReportSource = oRep; fcr.ShowDialog(); }