Exemple #1
0
        private static void ParseQueryString(ExternalItemPath itemPath, IParametersTranslator paramsTranslator, NameValueCollection allParametersCollection, out NameValueCollection rsParameters, out NameValueCollection rcParameters, out NameValueCollection reportParameters, out DatasourceCredentialsCollection dsParameters, out Hashtable reverseLookup)
        {
            dsParameters     = null;
            reverseLookup    = null;
            rsParameters     = new NameValueCollection();
            rcParameters     = new NameValueCollection();
            reportParameters = new NameValueCollection();
            NameValueCollection nameValueCollection  = new NameValueCollection();
            NameValueCollection nameValueCollection2 = new NameValueCollection();
            ExternalItemPath    itemPath2            = null;

            if (allParametersCollection == null)
            {
                return;
            }
            ResolveServerParameters(paramsTranslator, allParametersCollection, rsParameters, rcParameters, nameValueCollection, nameValueCollection2, reportParameters, out reverseLookup, out itemPath2);
            if (itemPath2 != null && Localization.CatalogCultureCompare(itemPath.Value, itemPath2.Value) != 0)
            {
                rsParameters         = new NameValueCollection();
                rcParameters         = new NameValueCollection();
                nameValueCollection  = new NameValueCollection();
                nameValueCollection2 = new NameValueCollection();
                reportParameters     = new NameValueCollection();
                reverseLookup        = null;
                if (RSTrace.CatalogTrace.TraceInfo)
                {
                    string message = string.Format(CultureInfo.InvariantCulture, "Requested item path '{0}' doesn't match stored parameters path '{1}'.", itemPath.Value.MarkAsPrivate(), itemPath2.Value.MarkAsPrivate());
                    RSTrace.CatalogTrace.Trace(TraceLevel.Info, message);
                }
            }
            for (int i = 0; i < allParametersCollection.Count; i++)
            {
                string   text  = allParametersCollection.GetKey(i);
                string[] array = allParametersCollection.GetValues(i);
                if (array != null && text != null)
                {
                    if (StringSupport.EndsWith(text, ":isnull", ignoreCase: true, CultureInfo.InvariantCulture))
                    {
                        text  = text.Substring(0, text.Length - ":isnull".Length);
                        array = new string[1];
                    }
                    if (!TryToAddToCollection(text, array, "rs:", allowMultiValue: false, rsParameters) && !TryToAddToCollection(text, array, "rc:", allowMultiValue: false, rcParameters) && !TryToAddToCollection(text, array, "dsu:", allowMultiValue: false, nameValueCollection) && !TryToAddToCollection(text, array, "dsp:", allowMultiValue: false, nameValueCollection2))
                    {
                        TryToAddToCollection(text, array, "", allowMultiValue: true, reportParameters);
                    }
                }
            }
            dsParameters = new DatasourceCredentialsCollection(nameValueCollection, nameValueCollection2);
        }
Exemple #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)
                {
                    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();
            }
        }
Exemple #3
0
 public void ParseQueryString(NameValueCollection allParametersCollection, IParametersTranslator paramsTranslator, ExternalItemPath itemPath)
 {
     ParseQueryString(itemPath, paramsTranslator, allParametersCollection, out m_catalogParameters, out m_renderingParameters, out m_reportParameters, out m_datasourcesCred, out m_reverseLookupParameters);
     ApplyDefaultRenderingParameters();
 }