Exemple #1
0
        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++;
            }
        }
Exemple #2
0
        public void RenderSummary(ExtendedXlsFile xls, Func <Guid, ExcelFormula> getInnerFirstEntryFormulas)
        {
            if (getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330InputSummary.GetFormulaUid()).Elements.Count > 0)
            {
                xls.SetFormulaStyled(block.GetUsedRows(),
                                     block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm],
                                     getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330InputSummary.GetFormulaUid()),
                                     style);
            }

            if (getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330OutputSummary.GetFormulaUid()).Elements.Count > 0)
            {
                xls.SetFormulaStyled(block.GetUsedRows(),
                                     block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.OutputSumm],
                                     getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330OutputSummary.GetFormulaUid()),
                                     style);
            }

            if (getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid()).Elements.Count > 0)
            {
                xls.SetFormulaStyled(block.GetUsedRows(),
                                     block.InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.SaldoSumm],
                                     getInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid()),
                                     style);
            }

            //TODO: дублирование
            foreach (var voltage in block.InternalData.HeaderInputColumnNumbers)
            {
                if (getInnerFirstEntryFormulas(voltage.Value.FormulaUid).Elements.Count > 0)
                {
                    xls.SetFormulaStyled(block.GetUsedRows(),
                                         voltage.Value.ColumnNumber,
                                         getInnerFirstEntryFormulas(voltage.Value.FormulaUid),
                                         style);
                }
            }
            //TODO: дублирование
            foreach (var voltage in block.InternalData.HeaderOutputColumnNumbers)
            {
                if (getInnerFirstEntryFormulas(voltage.Value.FormulaUid).Elements.Count > 0)
                {
                    xls.SetFormulaStyled(block.GetUsedRows(),
                                         voltage.Value.ColumnNumber,
                                         getInnerFirstEntryFormulas(voltage.Value.FormulaUid),
                                         style);
                }
            }
        }