Ejemplo n.º 1
0
 public void SetReportParameters(NameValueCollection allReportParameters, IParametersTranslator paramsTranslator)
 {
     if (allReportParameters != null)
     {
         string text = allReportParameters["rs:StoredParametersID"];
         if (text != null)
         {
             ExternalItemPath    externalItemPath    = default(ExternalItemPath);
             NameValueCollection nameValueCollection = default(NameValueCollection);
             paramsTranslator.GetParamsInstance(text, out externalItemPath, out nameValueCollection);
             if (nameValueCollection == null)
             {
                 throw new StoredParameterNotFoundException(text.MarkAsPrivate());
             }
             NameValueCollection nameValueCollection2 = new NameValueCollection();
             foreach (string item in nameValueCollection)
             {
                 string[] values = nameValueCollection.GetValues(item);
                 RSRequestParameters.TryToAddToCollection(item, values, "", true, nameValueCollection2);
             }
             this.m_reportParameters = nameValueCollection2;
             return;
         }
     }
     this.SetReportParameters(allReportParameters);
 }
Ejemplo n.º 2
0
        private static void ResolveServerParameters(IParametersTranslator paramsTranslator, NameValueCollection allParametersCollection, NameValueCollection rsParameters, NameValueCollection rcParameters, NameValueCollection dsuParameters, NameValueCollection dspParameters, NameValueCollection reportParameters, out Hashtable reverseLookup, out ExternalItemPath itemPath)
        {
            reverseLookup = new Hashtable();
            itemPath      = null;
            StringCollection stringCollection = new StringCollection();

            for (int i = 0; i < allParametersCollection.Count; i++)
            {
                string key = allParametersCollection.GetKey(i);
                if (key != null && StringComparer.OrdinalIgnoreCase.Compare(key, "rs:StoredParametersID") == 0)
                {
                    string text = allParametersCollection[i];
                    NameValueCollection nameValueCollection = default(NameValueCollection);
                    paramsTranslator.GetParamsInstance(text, out itemPath, out nameValueCollection);
                    if (nameValueCollection == null)
                    {
                        throw new StoredParameterNotFoundException(text.MarkAsPrivate());
                    }
                    reverseLookup.Add(new ReportParameterCollection(nameValueCollection), text);
                    stringCollection.Add(key);
                    foreach (string item in nameValueCollection)
                    {
                        string[] values = nameValueCollection.GetValues(item);
                        if (!RSRequestParameters.TryToAddToCollection(item, values, "rs:", false, rsParameters) && !RSRequestParameters.TryToAddToCollection(item, values, "rc:", false, rcParameters) && !RSRequestParameters.TryToAddToCollection(item, values, "dsu:", false, dsuParameters) && !RSRequestParameters.TryToAddToCollection(item, values, "dsp:", false, dspParameters))
                        {
                            RSRequestParameters.TryToAddToCollection(item, values, "", true, reportParameters);
                        }
                    }
                }
            }
            StringEnumerator enumerator2 = stringCollection.GetEnumerator();

            try
            {
                while (enumerator2.MoveNext())
                {
                    string current = enumerator2.Current;
                    allParametersCollection.Remove(current);
                }
            }
            finally
            {
                IDisposable disposable = enumerator2 as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Ejemplo n.º 3
0
        private static void ResolveServerParameters(IParametersTranslator paramsTranslator, NameValueCollection allParametersCollection, NameValueCollection rsParameters, NameValueCollection rcParameters, NameValueCollection dsuParameters, NameValueCollection dspParameters, NameValueCollection reportParameters, out Hashtable reverseLookup, out ExternalItemPath itemPath)
        {
            reverseLookup = new Hashtable();
            itemPath      = null;
            StringCollection stringCollection = new StringCollection();

            for (int i = 0; i < allParametersCollection.Count; i++)
            {
                string key = allParametersCollection.GetKey(i);
                if (key == null || StringComparer.OrdinalIgnoreCase.Compare(key, "rs:StoredParametersID") != 0)
                {
                    continue;
                }
                string text = allParametersCollection[i];
                paramsTranslator.GetParamsInstance(text, out itemPath, out NameValueCollection parameters);
                if (parameters == null)
                {
                    throw new StoredParameterNotFoundException(text.MarkAsPrivate());
                }
                reverseLookup.Add(new ReportParameterCollection(parameters), text);
                stringCollection.Add(key);
                foreach (string item in parameters)
                {
                    string[] values = parameters.GetValues(item);
                    if (!TryToAddToCollection(item, values, "rs:", allowMultiValue: false, rsParameters) && !TryToAddToCollection(item, values, "rc:", allowMultiValue: false, rcParameters) && !TryToAddToCollection(item, values, "dsu:", allowMultiValue: false, dsuParameters) && !TryToAddToCollection(item, values, "dsp:", allowMultiValue: false, dspParameters))
                    {
                        TryToAddToCollection(item, values, "", allowMultiValue: true, reportParameters);
                    }
                }
            }
            StringEnumerator enumerator2 = stringCollection.GetEnumerator();

            try
            {
                while (enumerator2.MoveNext())
                {
                    string current = enumerator2.Current;
                    allParametersCollection.Remove(current);
                }
            }
            finally
            {
                (enumerator2 as IDisposable)?.Dispose();
            }
        }
Ejemplo n.º 4
0
 public void SetReportParameters(NameValueCollection allReportParameters, IParametersTranslator paramsTranslator)
 {
     if (allReportParameters != null)
     {
         string text = allReportParameters["rs:StoredParametersID"];
         if (text != null)
         {
             paramsTranslator.GetParamsInstance(text, out ExternalItemPath _, out NameValueCollection parameters);
             if (parameters == null)
             {
                 throw new StoredParameterNotFoundException(text.MarkAsPrivate());
             }
             NameValueCollection nameValueCollection = new NameValueCollection();
             foreach (string item in parameters)
             {
                 string[] values = parameters.GetValues(item);
                 TryToAddToCollection(item, values, "", allowMultiValue: true, nameValueCollection);
             }
             m_reportParameters = nameValueCollection;
             return;
         }
     }
     SetReportParameters(allReportParameters);
 }