public void ProcessBeginningAndEndingBalances() { //First, separate the duration columns and instant columns ArrayList durationColumnIndex = new ArrayList(); ArrayList instantColumnIndex = new ArrayList(); for (int colIndex = 0; colIndex < this.Columns.Count; colIndex++) { InstanceReportColumn irc = this.Columns[colIndex] as InstanceReportColumn; if (irc.MyContextProperty != null && irc.MyContextProperty.PeriodType == Element.PeriodType.duration) { durationColumnIndex.Add(colIndex); } else { instantColumnIndex.Add(colIndex); } } //Process Cash & Cash Equivalents Beginning/Ending Balances int beginingBalanceRowIndex = -1; int endingBalanceRowIndex = -1; for (int rowIndex = 0; rowIndex < this.Rows.Count; rowIndex++) { InstanceReportRow irr = this.Rows[rowIndex] as InstanceReportRow; if (!irr.IsReportTitle && !irr.IsSegmentTitle && (irr.IsBeginningBalance || irr.IsEndingBalance)) { if (irr.IsBeginningBalance) { beginingBalanceRowIndex = rowIndex; HandleBalances(true, irr, durationColumnIndex, instantColumnIndex); } if (irr.IsEndingBalance) { endingBalanceRowIndex = rowIndex; HandleBalances(false, irr, durationColumnIndex, instantColumnIndex); } } } //Check if one more step is necesary to realign the beginning/ending balances if (ReportUtils.IsCashFlowFromOps(this.ReportName) && beginingBalanceRowIndex != -1 && endingBalanceRowIndex != -1) { RealignCashRows(durationColumnIndex, beginingBalanceRowIndex, endingBalanceRowIndex); //Check if we should delete the "empty" instance column and possible extra duration columns DeleteEmptyColumns(beginingBalanceRowIndex, endingBalanceRowIndex, instantColumnIndex, durationColumnIndex); } }
public bool IsCashFlowFromOps() { return(ReportUtils.IsCashFlowFromOps(ShortName)); }