private bool write_totals_area(IEnumerable <PD.IElemento> detail, TituloCabera info, int RowPosition, int ColumnPosition, BorderPaintingFormat formatos) { try { Exc.Range celLrangE; celLrangE = _oSheet.Cells[RowPosition, ColumnPosition]; //Border Values formatos.ApplyFormats(celLrangE); if (info.Index != 0) { ColumnData data = RawDataColumn(detail, info); celLrangE.NumberFormat = data.Formating; if (data.ColType == typeof(decimal)) { decimal suma = 0; for (int i = 0; i < data.Valores.Length; i++) { suma += (decimal)(data.Valores[i, 0]); } celLrangE.Value = suma; } } return(true); } catch { return(false); } }
private bool write_tittle_area(TituloCabera info, int RowPosition, int ColumnPosition, BorderPaintingFormat formatos) { try { Exc.Range celLrangE; celLrangE = _oSheet.Cells[RowPosition, ColumnPosition]; //Format celLrangE.HorizontalAlignment = Exc.XlHAlign.xlHAlignCenter; //-4108 equivale a centrar celLrangE.VerticalAlignment = Exc.XlVAlign.xlVAlignCenter; celLrangE.WrapText = true; //equivale a alinear contenido a la celda celLrangE.Orientation = 0; celLrangE.AddIndent = false; celLrangE.IndentLevel = 0; celLrangE.ShrinkToFit = false; celLrangE.RowHeight = 30; //alto de fila se estable en 30 celLrangE.Font.Bold = true; //Border Format formatos.ApplyFormats(celLrangE); //Value celLrangE.Value = info.ColTitulo; celLrangE = null; return(true); } catch { return(false); } }
private bool write_content_area(IEnumerable <PD.IElemento> detail, TituloCabera info, int RowInitPosition, int TotalElements, int ColumnPosition, BorderPaintingFormat formatos) { try { Exc.Range celLrangE; celLrangE = _oSheet.Range[ _oSheet.Cells[RowInitPosition, ColumnPosition], _oSheet.Cells[(RowInitPosition + TotalElements - 1), ColumnPosition]]; //Border Values formatos.ApplyFormats(celLrangE); if (info.Index != 0) { ColumnData data = RawDataColumn(detail, info); celLrangE.NumberFormat = data.Formating; celLrangE.Value = data.Valores; } return(true); } catch { return(false); } }