Esempio n. 1
0
        internal string[] DisplayValues(Report rpt)
        {
            lock (this)
            {
                string[] dsplValues = rpt.Cache.Get(this, "displayvalues") as string[];
                object[] dataValues;

                if (dsplValues != null)
                {
                    return(dsplValues);
                }

                if (_DataSetReference != null)
                {
                    _DataSetReference.SupplyValues(rpt, out dsplValues, out dataValues);
                }
                else
                {
                    _ParameterValues.SupplyValues(rpt, out dsplValues, out dataValues);
                }

                if (dataValues == null)
                {
                    dataValues = new object[0];
                }
                if (dsplValues == null)
                {
                    dsplValues = new string[0];
                }

                // there shouldn't be a problem; but if there is it doesn't matter as values can be recreated
                try { rpt.Cache.Add(this, "datavalues", dataValues); }
                catch (Exception e1)
                {
                    rpt.rl.LogError(4, "Error caching data values.  " + e1.Message);
                }
                try { rpt.Cache.Add(this, "displayvalues", dsplValues); }
                catch (Exception e2)
                {
                    rpt.rl.LogError(4, "Error caching display values.  " + e2.Message);
                }

                return(dsplValues);
            }
        }
Esempio n. 2
0
        internal object[] GetValue(Report rpt)
        {
            if (_Values != null)
            {
                return(ValuesCalc(rpt));
            }
            object[] dValues = this.GetDataValues(rpt);
            if (dValues != null)
            {
                return(dValues);
            }

            string[] dsValues;
            if (_DataSetReference != null)
            {
                _DataSetReference.SupplyValues(rpt, out dsValues, out dValues);
            }

            this.SetDataValues(rpt, dValues);
            return(dValues);
        }