Exemple #1
0
        /// <summary>
        /// 获取设定值
        /// </summary>
        /// <returns></returns>
        private object GetValue()
        {
            string       Value = this._Value;
            ReportDetail ParentReportDetail = this.Group.ParentReport as ReportDetail;

            if (ParentReportDetail.IsPostBack)
            {
                Value = ParentReportDetail.Request.Form[ParentReportDetail.ClientID + "_" + this.Name];
                if (Value == null)
                {
                    Value = ParentReportDetail.Request.Form[this.Name];
                    if (Value == null)
                    {
                        Value = ParentReportDetail.Request.Form["htc_" + this.Name];
                        if (Value == null)
                        {
                            Value = ParentReportDetail.Request.Form["htc_" + ParentReportDetail.ClientID + "_" + this.Name];
                        }
                    }
                }
            }
            if (Value == null && this.FormatString != null)
            {
                System.Text.StringBuilder myTrueValues = new System.Text.StringBuilder();
                if (ParentReportDetail.IsPostBack && this.Values != null)
                {
                    ReportDetail myReportDetail = ParentReportDetail;
                    string []    FieldValues    = new string [this.Values.Length];
                    for (int index = 0; index < this.Values.Length; index++)
                    {
                        string FieldName  = this.Values[index];
                        string FieldValue = myReportDetail.Request.Form[myReportDetail.ClientID + "_" + FieldName];
                        if (FieldValue == null)
                        {
                            FieldValue = myReportDetail.Request.Form[FieldName];
                            if (FieldValue == null)
                            {
                                FieldValue = myReportDetail.Request.Form["htc_" + this.Name];
                                if (FieldValue == null)
                                {
                                    FieldValue = myReportDetail.Request.Form["htc_" + myReportDetail.ClientID + "_" + this.Name];
                                }
                            }
                        }
                        FieldValues[index] = FieldValue;
                        myTrueValues.Append(FieldValue);
                        if (index != this.Values.Length)
                        {
                            myTrueValues.Append("[valueitem]");
                        }
                    }
                    this._TrueValue = myTrueValues.ToString();
                    return(string.Format(this.FormatString, FieldValues));
                }
            }
            return(Value);
        }
Exemple #2
0
        /// <summary>
        /// 扫行格式化的时候,替换字符串的具体要求
        /// </summary>
        /// <param name="myMatch"></param>
        /// <returns></returns>
        private string ReplaceArgument2(Match myMatch)
        {
            string Key = myMatch.Value.Trim('{', '}');

            ReportDetail ParentReportDetail = this.Group.ParentReport as ReportDetail;

            //检验是否为自定义参数。
            if (ParentReportDetail.Argument[Key] != null)
            {
                this.isusedargument = true;
                return(ParentReportDetail.Argument[Key]);
            }
            else
            {
                return(myMatch.Value);
            }
        }
Exemple #3
0
        /// <summary>
        /// 执行格式化的时候,替换字符串的具体操作
        /// </summary>
        /// <param name="myMatch"></param>
        /// <returns></returns>
        private string ReplaceArgument(Match myMatch)
        {
            string Key = myMatch.Value.Trim('{', '}');

            //检验是否为自定义参数。
            ReportDetail ParentReportDetail = this.Group.ParentReport as ReportDetail;

            if (ParentReportDetail.Argument[Key] != null)
            {
                this.isusedargument = true;
                return(ParentReportDetail.Argument[Key]);
            }

            //赋予格式化序列元素
            this.myValues.Append(Key);
            this.myValues.Append(",");
            return("{" + (argumentindex++) + "}");
        }