public void RenderSummary(ExtendedXlsFile xls, Func <Guid, ExcelFormula> getInnerFirstEntryFormulas) { int currentCol = block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1; for (int i = 0; i < block.InternalData.NumbersValues; i++) { currentCol++; xls.SetFormulaStyled(block.GetUsedRows(), currentCol, getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummInForPs), style); block.AddCellToFormula(block.InternalData.IntervalFormulUids[i].SummInForPs, currentCol, block.GetUsedRows(), getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummInForPs).DoubleRepresentation(), Model.Formula.EnumExcelFormulaOperators.Plus); xls.SetFormulaStyled(block.GetUsedRows(), currentCol + 1, getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummOutForPs), style); block.AddCellToFormula(block.InternalData.IntervalFormulUids[i].SummOutForPs, currentCol + 1, block.GetUsedRows(), getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummOutForPs).DoubleRepresentation(), Model.Formula.EnumExcelFormulaOperators.Plus); xls.SetFormulaStyled(block.GetUsedRows(), currentCol + 2, getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummSaldoForPs), style); block.AddCellToFormula(block.InternalData.IntervalFormulUids[i].SummSaldoForPs, currentCol + 2, block.GetUsedRows(), getInnerFirstEntryFormulas(block.InternalData.IntervalFormulUids[i].SummSaldoForPs).DoubleRepresentation(), Model.Formula.EnumExcelFormulaOperators.Plus); currentCol++; currentCol++; } }
public void AddSummaryFormulas(ExtendedXlsFile xls, Func <Guid, ExcelFormula> getInnerFirstEntryFormulas) { block.AddCellToFormula(FormulaNamesEnum.Balance220330InputSummary.GetFormulaUid(), block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], block.GetUsedRows(), getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330InputSummary.GetFormulaUid()).DoubleRepresentation(), EnumExcelFormulaOperators.Plus); block.AddCellToFormula(FormulaNamesEnum.Balance220330OutputSummary.GetFormulaUid(), block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.OutputSumm], block.GetUsedRows(), getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330OutputSummary.GetFormulaUid()).DoubleRepresentation(), EnumExcelFormulaOperators.Plus); block.AddCellToFormula(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid(), block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.SaldoSumm], block.GetUsedRows(), getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid()).DoubleRepresentation(), EnumExcelFormulaOperators.Plus); foreach (var voltage in block.InternalData.HeaderInputColumnNumbers) { if (getInnerFirstEntryFormulas(voltage.Value.FormulaUid).Elements.Count > 0) { block.AddCellToFormula(voltage.Value.FormulaUid, voltage.Value.ColumnNumber, block.GetUsedRows(), getInnerFirstEntryFormulas(voltage.Value.FormulaUid).DoubleRepresentation(), EnumExcelFormulaOperators.Plus); } } foreach (var voltage in block.InternalData.HeaderOutputColumnNumbers) { if (getInnerFirstEntryFormulas(voltage.Value.FormulaUid).Elements.Count > 0) { block.AddCellToFormula(voltage.Value.FormulaUid, voltage.Value.ColumnNumber, block.GetUsedRows(), getInnerFirstEntryFormulas(voltage.Value.FormulaUid).DoubleRepresentation(), EnumExcelFormulaOperators.Plus); } } }