Ejemplo n.º 1
0
 public static List <Declaration> GetChunkDeclarations()
 {
     if (OnDemandProcessingManager.m_ChunkDeclarations == null)
     {
         List <Declaration> list = new List <Declaration>(21);
         list.Add(ScopeInstance.GetDeclaration());
         list.Add(ReportInstance.GetDeclaration());
         list.Add(DataSetInstance.GetDeclaration());
         list.Add(DataRegionInstance.GetDeclaration());
         list.Add(DataRegionMemberInstance.GetDeclaration());
         list.Add(DataCellInstance.GetDeclaration());
         list.Add(DataAggregateObjResult.GetDeclaration());
         list.Add(SubReportInstance.GetDeclaration());
         list.Add(GroupTreePartition.GetDeclaration());
         list.Add(ReportSnapshot.GetDeclaration());
         list.Add(ParametersImplWrapper.GetDeclaration());
         list.Add(ParameterImplWrapper.GetDeclaration());
         list.Add(SubReportInfo.GetDeclaration());
         list.Add(ParameterInfo.GetNewDeclaration());
         list.Add(ParameterInfoCollection.GetDeclaration());
         list.Add(ParameterBase.GetNewDeclaration());
         list.Add(ValidValue.GetNewDeclaration());
         list.Add(FieldInfo.GetDeclaration());
         list.Add(TreePartitionManager.GetDeclaration());
         list.Add(LookupObjResult.GetDeclaration());
         list.Add(DataCellInstanceList.GetDeclaration());
         return(list);
     }
     return(OnDemandProcessingManager.m_ChunkDeclarations);
 }
Ejemplo n.º 2
0
 internal static List <Declaration> GetChunkDeclarations()
 {
     if (m_ChunkDeclarations == null)
     {
         return(new List <Declaration>(21)
         {
             ScopeInstance.GetDeclaration(),
             ReportInstance.GetDeclaration(),
             DataSetInstance.GetDeclaration(),
             DataRegionInstance.GetDeclaration(),
             DataRegionMemberInstance.GetDeclaration(),
             DataCellInstance.GetDeclaration(),
             DataAggregateObjResult.GetDeclaration(),
             SubReportInstance.GetDeclaration(),
             GroupTreePartition.GetDeclaration(),
             ReportSnapshot.GetDeclaration(),
             ParametersImplWrapper.GetDeclaration(),
             ParameterImplWrapper.GetDeclaration(),
             SubReportInfo.GetDeclaration(),
             ParameterInfo.GetNewDeclaration(),
             ParameterInfoCollection.GetDeclaration(),
             ParameterBase.GetNewDeclaration(),
             ValidValue.GetNewDeclaration(),
             FieldInfo.GetDeclaration(),
             TreePartitionManager.GetDeclaration(),
             LookupObjResult.GetDeclaration(),
             DataCellInstanceList.GetDeclaration()
         });
     }
     return(m_ChunkDeclarations);
 }
        public void NextRow()
        {
            long           streamOffset = this.m_odpContext.ReportObjectModel.FieldsImpl.StreamOffset;
            int            num          = -1;
            CommonRowCache tablixProcessingLookupRowCache = this.m_odpContext.TablixProcessingLookupRowCache;

            if (this.m_mustBufferAllRows)
            {
                num = tablixProcessingLookupRowCache.AddRow(RuntimeDataTablixObj.SaveData(this.m_odpContext));
                if (this.m_firstRowCacheIndex == -1)
                {
                    this.m_firstRowCacheIndex = num;
                }
            }
            IScalabilityCache tablixProcessingScalabilityCache = this.m_odpContext.TablixProcessingScalabilityCache;

            for (int i = 0; i < this.m_dataSet.LookupDestinationInfos.Count; i++)
            {
                LookupDestinationInfo lookupDestinationInfo = this.m_dataSet.LookupDestinationInfos[i];
                LookupObjResult       lookupObjResult       = this.m_dataSetInstance.LookupResults[i];
                if (!lookupObjResult.ErrorOccured)
                {
                    AspNetCore.ReportingServices.RdlExpressions.VariantResult variantResult = lookupDestinationInfo.EvaluateDestExpr(this.m_odpContext, lookupObjResult);
                    if (variantResult.ErrorOccurred)
                    {
                        lookupObjResult.DataFieldStatus = variantResult.FieldStatus;
                    }
                    else
                    {
                        object      value       = variantResult.Value;
                        LookupTable lookupTable = lookupObjResult.GetLookupTable(this.m_odpContext);
                        try
                        {
                            LookupMatches lookupMatches = default(LookupMatches);
                            IDisposable   disposable    = default(IDisposable);
                            if (!lookupTable.TryGetAndPinValue(value, out lookupMatches, out disposable))
                            {
                                lookupMatches = ((!lookupDestinationInfo.UsedInSameDataSetTablixProcessing) ? new LookupMatches() : new LookupMatchesWithRows());
                                disposable    = lookupTable.AddAndPin(value, lookupMatches);
                            }
                            if (lookupDestinationInfo.IsMultiValue || !lookupMatches.HasRow)
                            {
                                lookupMatches.AddRow(streamOffset, num, tablixProcessingScalabilityCache);
                            }
                            disposable.Dispose();
                        }
                        catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError)
                        {
                            throw new ReportProcessingException(this.m_lookupOwner.RegisterSpatialElementComparisonError(reportProcessingException_SpatialTypeComparisonError.Type));
                        }
                    }
                }
            }
            if (!this.m_mustBufferAllRows)
            {
                this.m_lookupOwner.PostLookupNextRow();
            }
        }
 public void CompleteLookupProcessing()
 {
     for (int i = 0; i < this.m_dataSetInstance.LookupResults.Count; i++)
     {
         LookupObjResult lookupObjResult = this.m_dataSetInstance.LookupResults[i];
         lookupObjResult.TransferToLookupCache(this.m_odpContext);
     }
     if (this.m_odpContext.TablixProcessingLookupRowCache != null)
     {
         this.m_odpContext.TablixProcessingLookupRowCache.Dispose();
         this.m_odpContext.TablixProcessingLookupRowCache = null;
     }
 }
        private void InitializeRuntimeStructures()
        {
            Global.Tracer.Assert(m_dataSet.LookupDestinationInfos != null && m_dataSet.LookupDestinationInfos.Count > 0, "Attempted to perform Lookup processing on a DataSet with no Lookups");
            IScalabilityCache tablixProcessingScalabilityCache = m_odpContext.TablixProcessingScalabilityCache;

            Global.Tracer.Assert(tablixProcessingScalabilityCache != null, "Cannot start Lookup processing unless Scalability is setup");
            if (m_mustBufferAllRows)
            {
                m_odpContext.TablixProcessingLookupRowCache = new CommonRowCache(tablixProcessingScalabilityCache);
            }
            int count = m_dataSet.LookupDestinationInfos.Count;
            List <LookupObjResult> list = new List <LookupObjResult>(count);

            m_dataSetInstance.LookupResults = list;
            for (int i = 0; i < count; i++)
            {
                LookupDestinationInfo lookupDestinationInfo = m_dataSet.LookupDestinationInfos[i];
                LookupObjResult       item = new LookupObjResult(new LookupTable(tablixProcessingScalabilityCache, m_odpContext.ProcessingComparer, lookupDestinationInfo.UsedInSameDataSetTablixProcessing));
                list.Add(item);
            }
        }
Ejemplo n.º 6
0
        public object[] EvaluateLookup()
        {
            bool flag = this.m_lookupInfo.ReturnFirstMatchOnly();
            OnDemandProcessingContext odpContext = this.m_reportRuntime.ReportObjectModel.OdpContext;

            AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet = odpContext.ReportDefinition.MappingDataSetIndexToDataSet[this.m_lookupInfo.DataSetIndexInCollection];
            DataSetInstance dataSetInstance = odpContext.GetDataSetInstance(dataSet);

            if (dataSetInstance == null)
            {
                throw new ReportProcessingException_InvalidOperationException();
            }
            if (dataSetInstance.NoRows)
            {
                return(LookupImpl.EmptyResult);
            }
            if (dataSetInstance.LookupResults == null || dataSetInstance.LookupResults[this.m_lookupInfo.DestinationIndexInCollection] == null)
            {
                if (!odpContext.CalculateLookup(this.m_lookupInfo))
                {
                    return(LookupImpl.EmptyResult);
                }
                Global.Tracer.Assert(null != dataSetInstance.LookupResults, "Lookup not initialized correctly by tablix processing");
            }
            LookupObjResult lookupObjResult = dataSetInstance.LookupResults[this.m_lookupInfo.DestinationIndexInCollection];

            if (lookupObjResult.ErrorOccured)
            {
                IErrorContext reportRuntime = this.m_reportRuntime;
                if (lookupObjResult.DataFieldStatus == DataFieldStatus.None && lookupObjResult.ErrorCode != 0)
                {
                    reportRuntime.Register(lookupObjResult.ErrorCode, lookupObjResult.ErrorSeverity, lookupObjResult.ErrorMessageArgs);
                }
                else if (lookupObjResult.DataFieldStatus == DataFieldStatus.UnSupportedDataType)
                {
                    reportRuntime.Register(ProcessingErrorCode.rsLookupOfInvalidExpressionDataType, Severity.Warning, lookupObjResult.ErrorMessageArgs);
                }
                throw new ReportProcessingException_InvalidOperationException();
            }
            AspNetCore.ReportingServices.RdlExpressions.VariantResult result = this.m_lookupInfo.EvaluateSourceExpr(this.m_reportRuntime);
            this.CheckExprResultError(result);
            bool           flag2                         = lookupObjResult.HasBeenTransferred || odpContext.CurrentDataSetIndex != dataSet.IndexInCollection;
            List <object>  list                          = null;
            CompareInfo    compareInfo                   = null;
            CompareOptions clrCompareOptions             = CompareOptions.None;
            bool           nullsAsBlanks                 = false;
            bool           useOrdinalStringKeyGeneration = false;

            try
            {
                if (flag2)
                {
                    compareInfo                   = odpContext.CompareInfo;
                    clrCompareOptions             = odpContext.ClrCompareOptions;
                    nullsAsBlanks                 = odpContext.NullsAsBlanks;
                    useOrdinalStringKeyGeneration = odpContext.UseOrdinalStringKeyGeneration;
                    dataSetInstance.SetupCollationSettings(odpContext);
                }
                LookupTable lookupTable = lookupObjResult.GetLookupTable(odpContext);
                Global.Tracer.Assert(lookupTable != null, "LookupTable must not be null");
                ObjectModelImpl reportObjectModel = odpContext.ReportObjectModel;
                AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader dataChunkReader = null;
                if (flag2)
                {
                    dataChunkReader = odpContext.GetDataChunkReader(dataSet.IndexInCollection);
                }
                using (reportObjectModel.SetupNewFieldsWithBackup(dataSet, dataSetInstance, dataChunkReader))
                {
                    object[] array = result.Value as object[];
                    if (array == null)
                    {
                        array = new object[1]
                        {
                            result.Value
                        };
                    }
                    else
                    {
                        list = new List <object>(array.Length);
                    }
                    object[] array2 = array;
                    foreach (object key in array2)
                    {
                        LookupMatches lookupMatches = default(LookupMatches);
                        if (lookupTable.TryGetValue(key, out lookupMatches))
                        {
                            int num = flag ? 1 : lookupMatches.MatchCount;
                            if (list == null)
                            {
                                list = new List <object>(num);
                            }
                            for (int j = 0; j < num; j++)
                            {
                                lookupMatches.SetupRow(j, odpContext);
                                AspNetCore.ReportingServices.RdlExpressions.VariantResult result2 = this.m_lookupInfo.EvaluateResultExpr(this.m_reportRuntime);
                                this.CheckExprResultError(result2);
                                list.Add(result2.Value);
                            }
                        }
                    }
                }
            }
            finally
            {
                if (compareInfo != null)
                {
                    odpContext.SetComparisonInformation(compareInfo, clrCompareOptions, nullsAsBlanks, useOrdinalStringKeyGeneration);
                }
            }
            object[] result3 = LookupImpl.EmptyResult;
            if (list != null)
            {
                result3 = list.ToArray();
            }
            return(result3);
        }
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.DataCellInstance:
                persistObj = new DataCellInstance();
                break;

            case ObjectType.DataAggregateObjResult:
                persistObj = new DataAggregateObjResult();
                break;

            case ObjectType.DataRegionMemberInstance:
                persistObj = new DataRegionMemberInstance();
                break;

            case ObjectType.DataRegionInstance:
                persistObj = new DataRegionInstance();
                break;

            case ObjectType.DataSetInstance:
                persistObj = new DataSetInstance();
                break;

            case ObjectType.ReportInstance:
                persistObj = new ReportInstance();
                break;

            case ObjectType.OnDemandMetadata:
                persistObj = new OnDemandMetadata();
                break;

            case ObjectType.GroupTreePartition:
                persistObj = new GroupTreePartition();
                break;

            case ObjectType.IntermediateFormatVersion:
                persistObj = new IntermediateFormatVersion();
                break;

            case ObjectType.ReportSnapshot:
                persistObj = new ReportSnapshot();
                break;

            case ObjectType.SubReportInstance:
                persistObj = new SubReportInstance();
                break;

            case ObjectType.Parameters:
                persistObj = new ParametersImplWrapper();
                break;

            case ObjectType.Parameter:
                persistObj = new ParameterImplWrapper();
                break;

            case ObjectType.SubReportInfo:
                persistObj = new SubReportInfo();
                break;

            case ObjectType.CommonSubReportInfo:
                persistObj = new CommonSubReportInfo();
                break;

            case ObjectType.ParameterInfo:
                persistObj = new ParameterInfo();
                break;

            case ObjectType.ParameterInfoCollection:
                persistObj = new ParameterInfoCollection();
                break;

            case ObjectType.ParametersLayout:
                persistObj = new ParametersGridLayout();
                break;

            case ObjectType.ParameterGridLayoutCellDefinition:
                persistObj = new ParameterGridLayoutCellDefinition();
                break;

            case ObjectType.ValidValue:
                persistObj = new ValidValue();
                break;

            case ObjectType.FieldInfo:
                persistObj = new FieldInfo();
                break;

            case ObjectType.ImageInfo:
                persistObj = new ImageInfo();
                break;

            case ObjectType.TreePartitionManager:
                persistObj = new TreePartitionManager();
                break;

            case ObjectType.LookupObjResult:
                persistObj = new LookupObjResult();
                break;

            case ObjectType.ShapefileInfo:
                persistObj = new ShapefileInfo();
                break;

            case ObjectType.UpdatedVariableValues:
                persistObj = new UpdatedVariableValues();
                break;

            case ObjectType.DataCellInstanceList:
                persistObj = new DataCellInstanceList();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }