public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { ReporteNits rpt = new ReporteNits(); rpt.Site = this.Site; return(rpt); }
private void GenerarReporte(string tipo) { List <NitsDataSourceShow> nits = new List <NitsDataSourceShow>(); if ("numero".Equals(tipo)) { nits = this.negocioNits.CargarNitsReporteOrdeNumero(); } else { nits = this.negocioNits.CargarNitsReporteOrdNombre(); } this.Size = new Size(840, 566); List <NitsDataSourceReports> nitsR = new List <NitsDataSourceReports>(); EmpresaDataSource empresa = new EmpresaDataSource(); empresa = this.negocioEmpresa.DevolverDatosEmpresa(Program.compa); foreach (NitsDataSourceShow item in nits) { NitsDataSourceReports nitR = new NitsDataSourceReports(); nitR.Nit = item.Nit; nitR.Digito = item.Digito; nitR.Tiponit = item.Tiponit; nitR.Nombrenit = item.Nombrenit; nitR.Direccion = item.Direccion; nitR.Telefono = item.Telefono; nitR.Celular = item.Celular; nitR.Idpais = item.NombrePais; nitR.Iddepartamento = item.NombreDepto; nitR.Idciudad = item.NombreCiudad; nitR.Compania_nits = empresa.Nombrecia; nitsR.Add(nitR); } ReporteNits reportnit = new ReporteNits(); reportnit.SetDataSource(nitsR); crystal_reportnits.ReportSource = reportnit; }