Esempio n. 1
0
 private string SetCommandText(IDbCommand command)
 {
     try
     {
         if (this.m_dataSet.Query.CommandText != null)
         {
             AspNetCore.ReportingServices.RdlExpressions.StringResult stringResult = this.m_odpContext.ReportRuntime.EvaluateCommandText(this.m_dataSet);
             if (stringResult.ErrorOccurred)
             {
                 throw new ReportProcessingException(ErrorCode.rsQueryCommandTextProcessingError, this.m_dataSet.Name.MarkAsPrivate());
             }
             command.CommandText = stringResult.Value;
             if (this.m_odpContext.UseVerboseExecutionLogging)
             {
                 this.m_executionMetrics.CommandText = stringResult.Value;
             }
             return(stringResult.Value);
         }
         return(null);
     }
     catch (Exception innerException)
     {
         throw new ReportProcessingException(ErrorCode.rsErrorSettingCommandText, innerException, this.m_dataSet.Name.MarkAsPrivate());
     }
 }
Esempio n. 2
0
 private string EvaluateConnectStringExpression(OnDemandProcessingContext processingContext)
 {
     if (this.m_connectString == null)
     {
         return(null);
     }
     if (ExpressionInfo.Types.Constant == this.m_connectString.Type)
     {
         return(this.m_connectString.StringValue);
     }
     Global.Tracer.Assert(null != processingContext.ReportRuntime, "(null != processingContext.ReportRuntime)");
     if (processingContext.ReportRuntime.ReportExprHost != null)
     {
         this.SetExprHost(processingContext.ReportRuntime.ReportExprHost, processingContext.ReportObjectModel);
     }
     AspNetCore.ReportingServices.RdlExpressions.StringResult stringResult = processingContext.ReportRuntime.EvaluateConnectString(this);
     if (stringResult.ErrorOccurred)
     {
         throw new ReportProcessingException(ErrorCode.rsDataSourceConnectStringProcessingError, this.m_name);
     }
     return(stringResult.Value);
 }
Esempio n. 3
0
        public bool PassFilters(object dataInstance, out bool specialFilter)
        {
            bool flag = true;

            specialFilter = false;
            if (this.m_failFilters)
            {
                return(false);
            }
            if (this.m_filters != null)
            {
                for (int num = this.m_startFilterIndex; num < this.m_filters.Count; num++)
                {
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Filter filter = this.m_filters[num];
                    if (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.Like == filter.Operator)
                    {
                        AspNetCore.ReportingServices.RdlExpressions.StringResult stringResult = this.m_processingContext.ReportRuntime.EvaluateFilterStringExpression(filter, this.m_objectType, this.m_objectName);
                        this.ThrowIfErrorOccurred("FilterExpression", stringResult.ErrorOccurred, stringResult.FieldStatus);
                        Global.Tracer.Assert(null != filter.Values, "(null != filter.Values)");
                        Global.Tracer.Assert(1 <= filter.Values.Count, "(1 <= filter.Values.Count)");
                        AspNetCore.ReportingServices.RdlExpressions.StringResult stringResult2 = this.m_processingContext.ReportRuntime.EvaluateFilterStringValue(filter, 0, this.m_objectType, this.m_objectName);
                        this.ThrowIfErrorOccurred("FilterValue", stringResult2.ErrorOccurred, stringResult2.FieldStatus);
                        if (stringResult.Value != null && stringResult2.Value != null)
                        {
                            if (!stringResult.Value.Equals(stringResult2.Value, StringComparison.OrdinalIgnoreCase))
                            {
                                flag = false;
                            }
                        }
                        else if (stringResult.Value != null || stringResult2.Value != null)
                        {
                            flag = false;
                        }
                    }
                    else
                    {
                        AspNetCore.ReportingServices.RdlExpressions.VariantResult variantResult = this.m_processingContext.ReportRuntime.EvaluateFilterVariantExpression(filter, this.m_objectType, this.m_objectName);
                        this.ThrowIfErrorOccurred("FilterExpression", variantResult.ErrorOccurred, variantResult.FieldStatus);
                        object value = variantResult.Value;
                        if (filter.Operator == AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.Equal || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.NotEqual == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThan == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThanOrEqual == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThan == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThanOrEqual == filter.Operator)
                        {
                            object value2 = this.EvaluateFilterValue(filter);
                            int    num2   = 0;
                            try
                            {
                                num2 = this.Compare(value, value2);
                            }
                            catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError)
                            {
                                throw new ReportProcessingException(this.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError.Type));
                            }
                            catch (ReportProcessingException_ComparisonError e)
                            {
                                throw new ReportProcessingException(this.RegisterComparisonError(e));
                            }
                            catch (Exception e2)
                            {
                                if (AsynchronousExceptionDetection.IsStoppingException(e2))
                                {
                                    throw;
                                }
                                throw new ReportProcessingException(this.RegisterComparisonError());
                            }
                            if (flag)
                            {
                                switch (filter.Operator)
                                {
                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.Equal:
                                    if (num2 != 0)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.NotEqual:
                                    if (num2 == 0)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThan:
                                    if (0 >= num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThanOrEqual:
                                    if (0 > num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThan:
                                    if (0 <= num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThanOrEqual:
                                    if (0 < num2)
                                    {
                                        flag = false;
                                    }
                                    break;
                                }
                            }
                        }
                        else if (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.In == filter.Operator)
                        {
                            object[] array = this.EvaluateFilterValues(filter);
                            flag = false;
                            if (array != null)
                            {
                                for (int i = 0; i < array.Length; i++)
                                {
                                    try
                                    {
                                        if (array[i] is ICollection)
                                        {
                                            foreach (object item in (ICollection)array[i])
                                            {
                                                if (this.Compare(value, item) == 0)
                                                {
                                                    flag = true;
                                                    break;
                                                }
                                            }
                                        }
                                        else if (this.Compare(value, array[i]) == 0)
                                        {
                                            flag = true;
                                        }
                                        if (flag)
                                        {
                                            goto IL_05f4;
                                        }
                                    }
                                    catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError2)
                                    {
                                        throw new ReportProcessingException(this.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError2.Type));
                                    }
                                    catch (ReportProcessingException_ComparisonError e3)
                                    {
                                        throw new ReportProcessingException(this.RegisterComparisonError(e3));
                                    }
                                    catch (Exception e4)
                                    {
                                        if (AsynchronousExceptionDetection.IsStoppingException(e4))
                                        {
                                            throw;
                                        }
                                        throw new ReportProcessingException(this.RegisterComparisonError());
                                    }
                                }
                            }
                        }
                        else if (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.Between == filter.Operator)
                        {
                            object[] array2 = this.EvaluateFilterValues(filter);
                            flag = false;
                            Global.Tracer.Assert(array2 != null && 2 == array2.Length, "(null != values && 2 == values.Length)");
                            try
                            {
                                if (0 <= this.Compare(value, array2[0]) && 0 >= this.Compare(value, array2[1]))
                                {
                                    flag = true;
                                }
                            }
                            catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError3)
                            {
                                throw new ReportProcessingException(this.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError3.Type));
                            }
                            catch (ReportProcessingException_ComparisonError e5)
                            {
                                throw new ReportProcessingException(this.RegisterComparisonError(e5));
                            }
                            catch (RSException)
                            {
                                throw;
                            }
                            catch (Exception e6)
                            {
                                if (AsynchronousExceptionDetection.IsStoppingException(e6))
                                {
                                    throw;
                                }
                                throw new ReportProcessingException(this.RegisterComparisonError());
                            }
                        }
                        else if (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopN == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.BottomN == filter.Operator)
                        {
                            if (this.m_filterInfo == null)
                            {
                                Global.Tracer.Assert(filter.Values != null && 1 == filter.Values.Count, "(null != filter.Values && 1 == filter.Values.Count)");
                                AspNetCore.ReportingServices.RdlExpressions.IntegerResult integerResult = this.m_processingContext.ReportRuntime.EvaluateFilterIntegerValue(filter, 0, this.m_objectType, this.m_objectName);
                                this.ThrowIfErrorOccurred("FilterValue", integerResult.ErrorOccurred, integerResult.FieldStatus);
                                int       value3   = integerResult.Value;
                                IComparer comparer = (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopN != filter.Operator) ? ((IComparer) new MyBottomComparer(this.m_processingContext.ProcessingComparer)) : ((IComparer) new MyTopComparer(this.m_processingContext.ProcessingComparer));
                                this.InitFilterInfos(new MySortedListWithMaxSize(comparer, value3, this), num);
                            }
                            this.SortAndSave(value, dataInstance);
                            flag          = false;
                            specialFilter = true;
                        }
                        else if (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopPercent == filter.Operator || AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.BottomPercent == filter.Operator)
                        {
                            if (this.m_filterInfo == null)
                            {
                                Global.Tracer.Assert(filter.Values != null && 1 == filter.Values.Count, "(null != filter.Values && 1 == filter.Values.Count)");
                                AspNetCore.ReportingServices.RdlExpressions.FloatResult floatResult = this.m_processingContext.ReportRuntime.EvaluateFilterIntegerOrFloatValue(filter, 0, this.m_objectType, this.m_objectName);
                                this.ThrowIfErrorOccurred("FilterValue", floatResult.ErrorOccurred, floatResult.FieldStatus);
                                double    value4    = floatResult.Value;
                                IComparer comparer2 = (AspNetCore.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopPercent != filter.Operator) ? ((IComparer) new MyBottomComparer(this.m_processingContext.ProcessingComparer)) : ((IComparer) new MyTopComparer(this.m_processingContext.ProcessingComparer));
                                this.InitFilterInfos(new MySortedListWithoutMaxSize(comparer2, this), num);
                                this.m_filterInfo.Percentage = value4;
                                this.m_filterInfo.Operator   = filter.Operator;
                            }
                            this.SortAndSave(value, dataInstance);
                            flag          = false;
                            specialFilter = true;
                        }
                    }
                    goto IL_05f4;
IL_05f4:
                    if (!flag)
                    {
                        return(false);
                    }
                }
            }
            return(flag);
        }