Beispiel #1
0
        public static void SetupField(C1FlexReport report, TextField f, string createInfo)
        {
            // get expression
            if (createInfo != null && _fieldList.Contains(createInfo))
            {
                string expression = _fieldList[createInfo] as string;
                // System.Diagnostics.Debug.Assert(expression != null);


                // if the field expression starts with an equals sign, evaluate
                // the expression at creation time and store the value
                if (expression.StartsWith("="))
                {
                    f.Text = report.Evaluate(expression.Substring(1)).ToString();
                }
                else // otherwise, evaluate at render time
                {
                    f.Text = "=" + expression;
                }
            }
            else
            {
                // arbitrary formula:
                f.Text = ("=" + createInfo) ?? "data";
            }
        }