private void xrtbEnum_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { ReporteMantenimientosRealizadosDS Fitro = this.DataSource as ReporteMantenimientosRealizadosDS; }
private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { var anio = this.anioCurso; string unidadID = GetCurrentColumnValue <string>("UnidadID"); ReporteMantenimientosRealizadosDS dataset = this.DataSource as ReporteMantenimientosRealizadosDS; #region Seleccion de datos if (!dataset.EquipoAliado.Any(x => x.UnidadID.Equals(unidadID))) { this.xrsEquiposSemestre1.Visible = false; this.xrsEquiposSemestre2.Visible = false; this.xrtbEnum.HeightF = 208.5f; this.xrTableCell281.HeightF = 208.5f; this.xrTableCell281.HeightF = 208.5f; this.xrTable110.HeightF = 208.5f; } else { this.xrsEquiposSemestre1.Visible = true; this.xrsEquiposSemestre2.Visible = true; if (dataset.EquipoAliado.Count(x => x.UnidadID.Equals(unidadID)) > 1) { int cantidadRowsAdicionales = (dataset.EquipoAliado.Count(x => x.UnidadID.Equals(unidadID)) - 1) * 2; int tamanioIncremento = 39 * cantidadRowsAdicionales; this.xrTable110.HeightF = (208.5f + tamanioIncremento); this.xrtbEnum.HeightF = (208.5f + tamanioIncremento); this.xrTableCell281.HeightF = (208.5f + tamanioIncremento); this.xrTableCell281.HeightF = (208.5f + tamanioIncremento); } } #endregion string UnidadAnterior = string.Empty; #region Seleccion de Mantenimiento por mes foreach (var row in dataset.ServicioUnidad.Where(x => x.Anio == anioCurso.Value && x.UnidadID == unidadID)) { switch (row["Mes"].ToString()) { #region Enero case "1": xrTableCell19.Text = row.Taller; xrtbTipoServicioEnero.Text = row.TipoServicio; xrtbFechaEnero.Text = row.FechaServicio.ToString(); xrtbkmHrsEnero.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrtbTipoProxSerEne.Text = row.TipoProximoSer.ToString(); xrtbFechaProxSerEne.Text = row.FechaProximoSer.ToString(); xrtbKmHrsProxSerEne.Text = row._km_HrsProximoSer.ToString(); } else { xrtbTipoProxSerEne.Text = string.Empty; xrtbFechaProxSerEne.Text = string.Empty; xrtbKmHrsProxSerEne.Text = string.Empty; } break; #endregion #region Febrero case "2": xrTableCell103.Text = row.Taller; xrTableCell105.Text = row.TipoServicio; xrTableCell106.Text = row.FechaServicio.ToString(); xrTableCell107.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell108.Text = row.TipoProximoSer.ToString(); xrTableCell109.Text = row.FechaProximoSer.ToString(); xrTableCell110.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell108.Text = string.Empty; xrTableCell109.Text = string.Empty; xrTableCell110.Text = string.Empty; } break; #endregion #region Marzo case "3": xrTableCell119.Text = row.Taller; xrTableCell121.Text = row.TipoServicio; xrTableCell122.Text = row.FechaServicio.ToString(); xrTableCell123.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell124.Text = row.TipoProximoSer.ToString(); xrTableCell125.Text = row.FechaProximoSer.ToString(); xrTableCell126.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell124.Text = string.Empty; xrTableCell125.Text = string.Empty; xrTableCell126.Text = string.Empty; } break; #endregion #region Abril case "4": xrTableCell135.Text = row.Taller; xrTableCell137.Text = row.TipoServicio; xrTableCell138.Text = row.FechaServicio.ToString(); xrTableCell139.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell140.Text = row.TipoProximoSer.ToString(); xrTableCell141.Text = row.FechaProximoSer.ToString(); xrTableCell142.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell140.Text = string.Empty; xrTableCell141.Text = string.Empty; xrTableCell142.Text = string.Empty; } break; #endregion #region Mayo case "5": xrTableCell151.Text = row.Taller; xrTableCell153.Text = row.TipoServicio; xrTableCell154.Text = row.FechaServicio.ToString(); xrTableCell155.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell156.Text = string.Empty; xrTableCell157.Text = string.Empty; xrTableCell158.Text = string.Empty; } break; #endregion #region Junio case "6": xrTableCell167.Text = row.Taller; xrTableCell169.Text = row.TipoServicio; xrTableCell170.Text = row.FechaServicio.ToString(); xrTableCell171.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell172.Text = row.TipoProximoSer.ToString(); xrTableCell173.Text = row.FechaProximoSer.ToString(); xrTableCell174.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell172.Text = string.Empty; xrTableCell173.Text = string.Empty; xrTableCell174.Text = string.Empty; } break; #endregion #region Julio case "7": xrTableCell63.Text = row.Taller; xrTableCell65.Text = row.TipoServicio; xrTableCell66.Text = row.FechaServicio.ToString(); xrTableCell67.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell68.Text = row.TipoProximoSer.ToString(); xrTableCell69.Text = row.FechaProximoSer.ToString(); xrTableCell70.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell68.Text = string.Empty; xrTableCell69.Text = string.Empty; xrTableCell70.Text = string.Empty; } break; #endregion #region Agosto case "8": xrTableCell88.Text = row.Taller; xrTableCell90.Text = row.TipoServicio; xrTableCell91.Text = row.FechaServicio.ToString(); xrTableCell92.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell93.Text = row.TipoProximoSer.ToString(); xrTableCell94.Text = row.FechaProximoSer.ToString(); xrTableCell95.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell93.Text = string.Empty; xrTableCell94.Text = string.Empty; xrTableCell95.Text = string.Empty; } break; #endregion #region Septiembre case "9": xrTableCell185.Text = row.Taller; xrTableCell187.Text = row.TipoServicio; xrTableCell188.Text = row.FechaServicio.ToString(); xrTableCell189.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell190.Text = row.TipoProximoSer.ToString(); xrTableCell191.Text = row.FechaProximoSer.ToString(); xrTableCell192.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell190.Text = string.Empty; xrTableCell191.Text = string.Empty; xrTableCell192.Text = string.Empty; } break; #endregion #region Octubre case "10": xrTableCell202.Text = row.Taller; xrTableCell204.Text = row.TipoServicio; xrTableCell205.Text = row.FechaServicio.ToString(); xrTableCell206.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell207.Text = row.TipoProximoSer.ToString(); xrTableCell208.Text = row.FechaProximoSer.ToString(); xrTableCell209.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell207.Text = string.Empty; xrTableCell208.Text = string.Empty; xrTableCell209.Text = string.Empty; } break; #endregion #region Noviembre case "11": xrTableCell219.Text = row.Taller; xrTableCell221.Text = row.TipoServicio; xrTableCell222.Text = row.FechaServicio.ToString(); xrTableCell223.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell224.Text = row.TipoProximoSer.ToString(); xrTableCell225.Text = row.FechaProximoSer.ToString(); xrTableCell226.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell224.Text = string.Empty; xrTableCell225.Text = string.Empty; xrTableCell226.Text = string.Empty; } break; #endregion #region Diciembre case "12": xrTableCell236.Text = row.Taller; xrTableCell238.Text = row.TipoServicio; xrTableCell239.Text = row.FechaServicio.ToString(); xrTableCell240.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell241.Text = row.TipoProximoSer.ToString(); xrTableCell242.Text = row.FechaProximoSer.ToString(); xrTableCell243.Text = row._km_HrsProximoSer.ToString(); } else { xrTableCell241.Text = string.Empty; xrTableCell242.Text = string.Empty; xrTableCell243.Text = string.Empty; } break; #endregion } } #endregion }
/// <summary> /// Evento de impresion de la banda de detalles /// </summary> private void Detail_BeforePrint(object sender, PrintEventArgs e) { var equipoAliadoID = GetCurrentColumnValue <string>("AliadoID"); ReporteMantenimientosRealizadosDS dataSource = this.DataSource as ReporteMantenimientosRealizadosDS; foreach (var row in dataSource.ServicioAliado.Where(x => x.Anio == anioCurso.Value && x.AliadoID == equipoAliadoID)) { if (this.semestre != null) { if (this.semestre == 1) { //#region Enero //xrTableCell22.Text = string.Empty; //xrtbTipoSerAliaEne.Text = string.Empty; //xrtbFechaSerAliaEne.Text = string.Empty; //xrtbKmHrsAliaEne.Text = string.Empty; //xrtbTipoSerProxAliaEne.Text = string.Empty; //xrtbFechaProxAliaEne.Text = string.Empty; //xrtbFechaProxAliaEne.Text = string.Empty; //#endregion //#region Febrero //xrTableCell1.Text = string.Empty; //xrTableCell8.Text = string.Empty; //xrTableCell9.Text = string.Empty; //xrTableCell10.Text = string.Empty; //xrTableCell4.Text = string.Empty; //xrTableCell5.Text = string.Empty; //xrTableCell6.Text = string.Empty; //#endregion //#region Marzo //xrTableCell11.Text = string.Empty; //xrTableCell16.Text = string.Empty; //xrTableCell17.Text = string.Empty; //xrTableCell18.Text = string.Empty; //xrTableCell13.Text = string.Empty; //xrTableCell14.Text = string.Empty; //xrTableCell15.Text = string.Empty; //#endregion //#region Abril //xrTableCell9.Text = string.Empty; //xrTableCell27.Text = string.Empty; //xrTableCell28.Text = string.Empty; //xrTableCell29.Text = string.Empty; //xrTableCell24.Text = string.Empty; //xrTableCell25.Text = string.Empty; //xrTableCell26.Text = string.Empty; //#endregion //#region Mayo //xrTableCell12.Text = string.Empty; //xrTableCell35.Text = string.Empty; //xrTableCell36.Text = string.Empty; //xrTableCell37.Text = string.Empty; //xrTableCell32.Text = string.Empty; //xrTableCell33.Text = string.Empty; //xrTableCell34.Text = string.Empty; //#endregion //#region Junio //xrTableCell15.Text = string.Empty; //xrTableCell43.Text = string.Empty; //xrTableCell44.Text = string.Empty; //xrTableCell45.Text = string.Empty; //xrTableCell40.Text = string.Empty; //xrTableCell41.Text = string.Empty; //xrTableCell42.Text = string.Empty; //#endregion switch (row["Mes"].ToString()) { #region Enero case "1": xrTableCell22.Text = row.Taller; xrtbTipoSerAliaEne.Text = row.TipoServicio; xrtbFechaSerAliaEne.Text = row.FechaServicio.ToString(); xrtbKmHrsAliaEne.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrtbTipoSerProxAliaEne.Text = row.TipoProximoSer.ToString(); xrtbFechaProxAliaEne.Text = row.FechaProximoSer.ToString(); xrtbFechaProxAliaEne.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Febrero case "2": xrTableCell1.Text = row.Taller; xrTableCell8.Text = row.TipoServicio; xrTableCell9.Text = row.FechaServicio.ToString(); xrTableCell10.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell4.Text = row.TipoProximoSer.ToString(); xrTableCell5.Text = row.FechaProximoSer.ToString(); xrTableCell6.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Marzo case "3": xrTableCell11.Text = row.Taller; xrTableCell16.Text = row.TipoServicio; xrTableCell17.Text = row.FechaServicio.ToString(); xrTableCell18.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell13.Text = row.TipoProximoSer.ToString(); xrTableCell14.Text = row.FechaProximoSer.ToString(); xrTableCell15.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Abril case "4": xrTableCell9.Text = row.Taller; xrTableCell27.Text = row.TipoServicio; xrTableCell28.Text = row.FechaServicio.ToString(); xrTableCell29.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell24.Text = row.TipoProximoSer.ToString(); xrTableCell25.Text = row.FechaProximoSer.ToString(); xrTableCell26.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Mayo case "5": xrTableCell12.Text = row.Taller; xrTableCell35.Text = row.TipoServicio; xrTableCell36.Text = row.FechaServicio.ToString(); xrTableCell37.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell32.Text = row.TipoProximoSer.ToString(); xrTableCell33.Text = row.FechaProximoSer.ToString(); xrTableCell34.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Junio case "6": xrTableCell15.Text = row.Taller; xrTableCell43.Text = row.TipoServicio; xrTableCell44.Text = row.FechaServicio.ToString(); xrTableCell45.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell40.Text = row.TipoProximoSer.ToString(); xrTableCell41.Text = row.FechaProximoSer.ToString(); xrTableCell42.Text = row._km_HrsProximoSer.ToString(); } break; #endregion } } else { //#region Julio //xrTableCell22.Text = string.Empty; //xrtbTipoSerAliaEne.Text = string.Empty; //xrtbFechaSerAliaEne.Text = string.Empty; //xrtbKmHrsAliaEne.Text = string.Empty; //xrtbTipoSerProxAliaEne.Text = string.Empty; //xrtbFechaProxAliaEne.Text = string.Empty; //xrtbFechaProxAliaEne.Text = string.Empty; //#endregion //#region Agosto //xrTableCell1.Text = string.Empty; //xrTableCell8.Text = string.Empty; //xrTableCell9.Text = string.Empty; //xrTableCell10.Text = string.Empty; //xrTableCell4.Text = string.Empty; //xrTableCell5.Text = string.Empty; //xrTableCell6.Text = string.Empty; //#endregion //#region Septiembre //xrTableCell11.Text = string.Empty; //xrTableCell16.Text = string.Empty; //xrTableCell17.Text = string.Empty; //xrTableCell18.Text = string.Empty; //xrTableCell13.Text = string.Empty; //xrTableCell14.Text = string.Empty; //xrTableCell15.Text = string.Empty; //#endregion //#region Octubre //xrTableCell9.Text = string.Empty; //xrTableCell27.Text = string.Empty; //xrTableCell28.Text = string.Empty; //xrTableCell29.Text = string.Empty; //xrTableCell24.Text = string.Empty; //xrTableCell25.Text = string.Empty; //xrTableCell26.Text = string.Empty; //#endregion //#region Noviembre //xrTableCell12.Text = string.Empty; //xrTableCell35.Text = string.Empty; //xrTableCell36.Text = string.Empty; //xrTableCell37.Text = string.Empty; //xrTableCell32.Text = string.Empty; //xrTableCell33.Text = string.Empty; //xrTableCell34.Text = string.Empty; //#endregion //#region Diciembre //xrTableCell38.Text = string.Empty; //xrTableCell43.Text = string.Empty; //xrTableCell44.Text = string.Empty; //xrTableCell45.Text = string.Empty; //xrTableCell40.Text = string.Empty; //xrTableCell41.Text = string.Empty; //xrTableCell42.Text = string.Empty; //#endregion switch (row["Mes"].ToString()) { #region Julio case "7": xrTableCell22.Text = row.Taller; xrtbTipoSerAliaEne.Text = row.TipoServicio; xrtbFechaSerAliaEne.Text = row.FechaServicio.ToString(); xrtbKmHrsAliaEne.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrtbTipoSerProxAliaEne.Text = row.TipoProximoSer.ToString(); xrtbFechaProxAliaEne.Text = row.FechaProximoSer.ToString(); xrtbFechaProxAliaEne.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Agosto case "8": xrTableCell1.Text = row.Taller; xrTableCell8.Text = row.TipoServicio; xrTableCell9.Text = row.FechaServicio.ToString(); xrTableCell10.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell4.Text = row.TipoProximoSer.ToString(); xrTableCell5.Text = row.FechaProximoSer.ToString(); xrTableCell6.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Septiembre case "9": xrTableCell11.Text = row.Taller; xrTableCell16.Text = row.TipoServicio; xrTableCell17.Text = row.FechaServicio.ToString(); xrTableCell18.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell13.Text = row.TipoProximoSer.ToString(); xrTableCell14.Text = row.FechaProximoSer.ToString(); xrTableCell15.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Octubre case "10": xrTableCell9.Text = row.Taller; xrTableCell27.Text = row.TipoServicio; xrTableCell28.Text = row.FechaServicio.ToString(); xrTableCell29.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell24.Text = row.TipoProximoSer.ToString(); xrTableCell25.Text = row.FechaProximoSer.ToString(); xrTableCell26.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Noviembre case "11": xrTableCell12.Text = row.Taller; xrTableCell35.Text = row.TipoServicio; xrTableCell36.Text = row.FechaServicio.ToString(); xrTableCell37.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell32.Text = row.TipoProximoSer.ToString(); xrTableCell33.Text = row.FechaProximoSer.ToString(); xrTableCell34.Text = row._km_HrsProximoSer.ToString(); } break; #endregion #region Diciembre case "12": xrTableCell38.Text = row.Taller; xrTableCell43.Text = row.TipoServicio; xrTableCell44.Text = row.FechaServicio.ToString(); xrTableCell45.Text = row._Km_Hrs.ToString(); if (!row.IsFechaProximoSerNull()) { xrTableCell40.Text = row.TipoProximoSer.ToString(); xrTableCell41.Text = row.FechaProximoSer.ToString(); xrTableCell42.Text = row._km_HrsProximoSer.ToString(); } break; #endregion } } } } }