SetRuntimeValue() 개인적인 메소드

private SetRuntimeValue ( Report rpt, object v ) : void
rpt Report
v object
리턴 void
예제 #1
0
        internal void SetRuntimeValues(Report rpt, IDictionary parms)
        {
            // Fill the values to use in the report parameters
            foreach (string pname in parms.Keys)                // Loop thru the passed parameters
            {
                ReportParameter rp = (ReportParameter)_Items[pname];
                if (rp == null)
                {                                 // When not found treat it as a warning message
                    if (!pname.StartsWith("rs:")) // don't care about report server parameters
                    {
                        rpt.rl.LogError(4, "Unknown ReportParameter passed '" + pname + "' ignored.");
                    }
                    continue;
                }

                rp.SetRuntimeValue(rpt, parms[pname]);
            }

            return;
        }
예제 #2
0
        internal void SetRuntimeValues(Report rpt, IDictionary parms)
        {
            // Fill the values to use in the report parameters
            foreach (string pname in parms.Keys)                // Loop thru the passed parameters
            {
                ReportParameter rp = (ReportParameter)_Items[pname];
                if (rp == null)
                {                                 // When not found treat it as a warning message
                    if (!pname.StartsWith("rs:")) // don't care about report server parameters
                    {
                        rpt.rl.LogError(4, "Unknown ReportParameter passed '" + pname + "' ignored.");
                    }
                    continue;
                }

                // Search for the valid values
                object parmValue = parms[pname];
                if (parmValue is string && rp.ValidValues != null)
                {
                    string[] dvs = rp.ValidValues.DisplayValues(rpt);
                    if (dvs != null && dvs.Length > 0)
                    {
                        for (int i = 0; i < dvs.Length; i++)
                        {
                            if (dvs[i] == (string)parmValue)
                            {
                                object[] dv = rp.ValidValues.DataValues(rpt);
                                parmValue = dv[i];
                                break;
                            }
                        }
                    }
                }
                rp.SetRuntimeValue(rpt, parmValue);
            }

            return;
        }