Пример #1
0
 /// <summary>
 /// Método para obtener el reporte del tiempo de servicios
 /// </summary>
 /// <param name="Conexion"></param>
 /// <returns></returns>
 public List <ReporteTiempoServicios> ObtenerReporteTiempoServicio(string Conexion)
 {
     try
     {
         List <ReporteTiempoServicios> Lista = new List <ReporteTiempoServicios>();
         ReporteTiempoServicios        Item;
         SqlDataReader Dr = SqlHelper.ExecuteReader(Conexion, "Reportes.spCSLDB_get_ReporteAGVTiempoServicios");
         while (Dr.Read())
         {
             Item            = new ReporteTiempoServicios();
             Item.IDEmpleado = !Dr.IsDBNull(Dr.GetOrdinal("IDEmpleado")) ? Dr.GetString(Dr.GetOrdinal("IDEmpleado")) : string.Empty;
             Item.Empleado   = !Dr.IsDBNull(Dr.GetOrdinal("Empleado")) ? Dr.GetString(Dr.GetOrdinal("Empleado")) : string.Empty;
             Item.IDProducto = !Dr.IsDBNull(Dr.GetOrdinal("IDProducto")) ? Dr.GetString(Dr.GetOrdinal("IDProducto")) : string.Empty;
             Item.Servicio   = !Dr.IsDBNull(Dr.GetOrdinal("Servicio")) ? Dr.GetString(Dr.GetOrdinal("Servicio")) : string.Empty;
             Item.TiempoAVG  = !Dr.IsDBNull(Dr.GetOrdinal("TiempoAVG")) ? Dr.GetString(Dr.GetOrdinal("TiempoAVG")) : string.Empty;
             Lista.Add(Item);
         }
         Dr.Close();
         return(Lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
 private void GenerarReporteTiempoServicio()
 {
     try
     {
         reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
         reportViewer1.ZoomMode    = ZoomMode.Percent;
         reportViewer1.ZoomPercent = 100;
         reportViewer1.LocalReport.DataSources.Clear();
         Reporte_Negocio        Negg         = new Reporte_Negocio();
         ReporteTiempoServicios Datosreporte = new ReporteTiempoServicios();
         Datosreporte.Listado = Negg.ObtenerReporteTiempoServicio();
         reportViewer1.LocalReport.EnableExternalImages = true;
         ReportParameter[] Parametros = new ReportParameter[5];
         Parametros[0] = new ReportParameter("Empresa", Comun.NombreComercial);
         Parametros[1] = new ReportParameter("Eslogan", Comun.Eslogan);
         Parametros[2] = new ReportParameter("Direccion", Comun.Direccion);
         Parametros[3] = new ReportParameter("TituloReporte", "REPORTE DE TIEMPO DE SERVICIOS");
         if (File.Exists(@"Resources\Documents\" + Comun.UrlLogo.ToLower()))
         {
             string Aux = new Uri(Path.Combine(System.Windows.Forms.Application.StartupPath, @"Resources\Documents\" + Comun.UrlLogo.ToLower())).AbsoluteUri;
             Parametros[4] = new ReportParameter("UrlLogo", new Uri(Path.Combine(System.Windows.Forms.Application.StartupPath, @"Resources\Documents\" + Comun.UrlLogo.ToLower())).AbsoluteUri);
         }
         else
         {
             Parametros[4] = new ReportParameter("UrlLogo", new Uri(Path.Combine(System.Windows.Forms.Application.StartupPath, @"Resources\Documents\Default.jpg")).AbsoluteUri);
         }
         this.reportViewer1.LocalReport.ReportEmbeddedResource = "StephManager.Informes.Reportes.TiempoServicios.rdlc";
         reportViewer1.LocalReport.SetParameters(Parametros);
         reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Listado", Datosreporte.Listado));
         this.reportViewer1.RefreshReport();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }