protected Cantidad_Company ObtenerInforme() { DataRow fila; //dr DataTable empresa = new DataTable(); //dt Cantidad_Company reporte = new Cantidad_Company(); //ci empresa = reporte.Tables["empresas"]; Usuario dao = new Usuario(); DataTable Intermedio = dao.obtenerCompanyReporte(); for (int i = 0; i < Intermedio.Rows.Count; i++) { fila = empresa.NewRow(); fila["id_empresa"] = int.Parse(Intermedio.Rows[i]["id_user"].ToString()); fila["empresa"] = Intermedio.Rows[i]["empresa"].ToString(); fila["nit"] = Intermedio.Rows[i]["nit"].ToString(); fila["direccion"] = Intermedio.Rows[i]["direccion"].ToString(); fila["telefono"] = Intermedio.Rows[i]["telefono"].ToString(); fila["descripcion"] = Intermedio.Rows[i]["descripcion"].ToString(); fila["img_empresa"] = CargarByte(Server.MapPath(Intermedio.Rows[i]["img_empresa"].ToString())); fila["cam_com"] = CargarByte(Server.MapPath(Intermedio.Rows[i]["cam_com"].ToString())); fila["rut"] = CargarByte(Server.MapPath(Intermedio.Rows[i]["rut"].ToString())); fila["id_user"] = int.Parse(Intermedio.Rows[i]["id_user"].ToString()); fila["id_pago"] = int.Parse(Intermedio.Rows[i]["id_pago"].ToString()); //fila["hyperlink"] = Intermedio.Rows[i]["archivo"].ToString(); //fila["hyperlinkk"] = Intermedio.Rows[i]["imagen"].ToString(); empresa.Rows.Add(fila); } return(reporte); }
protected void PoblarReporte() { try { Cantidad_Company reporte = ObtenerInforme(); CRS_ReporteCompanyy.ReportDocument.SetDataSource(reporte); CRV_ReporteCompanyy.ReportSource = CRS_ReporteCompanyy; } catch (Exception) { throw; } }