Example #1
0
        private string GetYTDPerColumn()
        {
            string ReturnValue;
            String reportytd;
            Boolean columnytd;

            System.Int32 Quarter;
            TRptUserFunctionsDate FnDate;
            ReturnValue = "";
            reportytd = parameters.Get("param_ytd", -1).ToString().ToLower();
            columnytd = parameters.Get("param_ytd", situation.GetColumn()).ToBool();

            if ((reportytd == "mixed") && columnytd)
            {
                ReturnValue = ReturnValue + "YTD";
            }

            if ((reportytd == "mixed") && (!columnytd))
            {
                // result := result + 'non YTD';
                if (parameters.Get("param_quarter").ToBool())
                {
                    Quarter = (parameters.Get("param_end_period_i", this.situation.GetColumn()).ToInt() - 1) / 3 + 1;
                    ReturnValue = "Quarter " + Quarter.ToString();
                }
                else
                {
                    FnDate = new TRptUserFunctionsDate(this.situation);
                    ReturnValue =
                        FnDate.GetMonthName(parameters.Get("param_ledger_number_i",
                                this.situation.GetColumn()).ToInt(),
                            parameters.Get("param_end_period_i", this.situation.GetColumn()).ToInt());
                }
            }

            // print the name of the month instead of nonytd, on multi period reports
            if (parameters.Get("param_multiperiod").ToBool() && (columnytd == false))
            {
                FnDate = new TRptUserFunctionsDate(this.situation);
                ReturnValue =
                    FnDate.GetMonthName(parameters.Get("param_ledger_number_i",
                            this.situation.GetColumn()).ToInt(),
                        parameters.Get("param_column_period_i", this.situation.GetColumn()).ToInt());
            }

            return ReturnValue;
        }