コード例 #1
0
        protected override void RenderFooter(ExtendedXlsFile xls)
        {
            xls.SetRowOutlineLevel(StartRow + 1, UsedRows, 1);

            UsedRows++;
            xls.SetCellValueStyled(UsedRows, NestingLevel, "Итого по " + Data, TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows, NestingLevel, UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);

            RenderSummaryBehavior behav = new RenderSummaryBehavior(this, TFlxFontStyles.Bold);

            behav.RenderSummary(xls, GetInnerFirstEntryFormulas);
            behav.AddSummaryFormulas(xls, GetInnerFirstEntryFormulas);
        }
コード例 #2
0
        protected override void RenderFooter(ExtendedXlsFile xls)
        {
            UsedRows++;
            xls.SetCellValueStyled(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName], "Всего по " + Data.Name, TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);

            RenderSummaryBehavior behav = new RenderSummaryBehavior(this, TFlxFontStyles.Bold);

            behav.RenderSummary(xls, GetInnerFirstEntryFormulas);
            if (Data.IsGroupUseInGeneralBalance)
            {
                behav.AddSummaryFormulas(xls, GetInnerFirstEntryFormulas);
            }

            if (Data.IsGroupUseInRelative)
            {
                AddCellToFormula(FormulaNamesEnum.Balance220330RelativeLosses.GetFormulaUid(),
                                 InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.SaldoSumm],
                                 UsedRows,
                                 GetInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid()).DoubleRepresentation(), EnumExcelFormulaOperators.Minus);
            }

            AddCellToFormula(FormulaNamesEnum.Balance220330AllOutputSummary.GetFormulaUid(),
                             InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.OutputSumm],
                             GetUsedRows(),
                             GetInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330OutputSummary.GetFormulaUid()).DoubleRepresentation(),
                             EnumExcelFormulaOperators.Plus);

            AddCellToFormula(FormulaNamesEnum.Balance220330AllSaldoSummary.GetFormulaUid(),
                             InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.SaldoSumm],
                             GetUsedRows(),
                             GetInnerFirstEntryFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid()).DoubleRepresentation(),
                             EnumExcelFormulaOperators.Plus);

            SetBorderAllCellsInBlock(xls, Color.Gray, TFlxBorderStyle.Dotted);
        }
コード例 #3
0
        protected override void RenderFooter(ExtendedXlsFile xls)
        {
            UsedRows++;
            xls.SetCellValue(UsedRows,
                             InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                             "Итого по ЕНЕС, кВт*ч",
                             InternalData.GetSectionNameFormat(xls));
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.TotalColumnsCount);
            UsedRows++;

            xls.SetCellValueStyled(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                                   "Всего по объектам ЕНЭС " + ((Data.VoltageClass == enumVoltageClassGlobal.V220AndLower) ? "220" : "330") + " кВ и выше", TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);

            RenderSummaryBehavior behav = new RenderSummaryBehavior(this, TFlxFontStyles.None);

            behav.RenderSummary(xls, GetFirstLevelFormulas);
            UsedRows++;

            xls.SetCellValueStyled(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                                   "Потери в " + ((Data.VoltageClass == enumVoltageClassGlobal.V220AndLower) ? "сети 220 кВ и ниже" : "сети 330 кВ и выше"),
                                   TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);

            var saldoFormula       = GetFirstLevelFormulas(FormulaNamesEnum.Balance220330SaldoSummary.GetFormulaUid());
            var balPartInRelLosses = GetFirstLevelFormulas(FormulaNamesEnum.Balance220330RelativeLosses.GetFormulaUid());

            xls.SetFormula(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm],
                           saldoFormula);
            UsedRows++;

            xls.SetCellValueStyled(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                                   ("Относительные потери в " +
                                    ((Data.VoltageClass == enumVoltageClassGlobal.V220AndLower) ? "сети 220 кВ и ниже" : "сети 330 кВ и выше") +
                                    " к отпуску в РСК и потребителям"), TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);

            string relativeLossesFormula;

            if (balPartInRelLosses.Elements.Count > 0)
            {
                if (InternalData.ExportType == TExportExcelAdapterType.toXLS)
                {
                    relativeLossesFormula = "=(" + saldoFormula.StringRepresentation() + ")/("
                                            + balPartInRelLosses.StringRepresentation() + ")*100";
                    xls.SetCellFloatValue(UsedRows,
                                          InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm],
                                          new TFormula(relativeLossesFormula));
                }
                else
                {
                    double relativeLosses = saldoFormula.DoubleRepresentation()
                                            / balPartInRelLosses.DoubleRepresentation() * 100;
                    xls.SetCellFloatValue(UsedRows,
                                          InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm],
                                          relativeLosses);
                }
            }
            else
            {
                xls.SetCellFloatValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], 0.000);
            }

            UsedRows++;

            xls.SetCellValueStyled(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                                   "Относительные нормативные потери в сети " +
                                   ((Data.VoltageClass == enumVoltageClassGlobal.V220AndLower) ? "220" : "330") + "кВ, %",
                                   TFlxFontStyles.Bold);
            xls.MergeCells(UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.BalPartName],
                           UsedRows,
                           InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1);
            xls.SetCellFloatValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], Data.HighLimit);
            UsedRows++;
            UsedRows++;

            if (InternalData.FlNoData || InternalData.FlagOVremark || InternalData.FlagManualStatusChange)
            {
                UsedRows++;
                UsedRows++;
                xls.SetCellValue(UsedRows,
                                 InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] - 1,
                                 "Примечание : ", InternalData.GetFootnoteFormat(xls));
            }
            if (InternalData.FlNoData)
            {
                UsedRows++;
                xls.SetCellBkColor(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], Color.LightPink);
                xls.SetCellValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, " - нет данных по одной или нескольким точкам измерения");
                xls.MergeCells(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, UsedRows, InternalData.TotalColumnsCount);
            }
            if (InternalData.FlagOVremark)
            {
                UsedRows++;
                xls.SetCellFloatValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], 0.0);
                xls.SetCellFontColor(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], Color.Red);
                xls.SetCellValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, " - обходной выключатель");
                xls.MergeCells(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, UsedRows, InternalData.TotalColumnsCount);
            }
            if (InternalData.FlagManualStatusChange)
            {
                UsedRows++;
                xls.SetCellBkColor(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm], Color.Yellow);
                xls.SetCellValue(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, " - вручную установлен некоммерческий статус");
                xls.MergeCells(UsedRows, InternalData.HeaderColumnNumbers[HeaderBal0LogicalParts.InputSumm] + 1, UsedRows, InternalData.TotalColumnsCount);
            }
        }