Esempio n. 1
0
        private void TrimInstanceSet(FilterInfo filterInfo)
        {
            if (-1.0 == filterInfo.Percentage)
            {
                return;
            }
            int    instanceCount = filterInfo.InstanceCount;
            double num           = (double)instanceCount * filterInfo.Percentage / 100.0;

            if (num <= 0.0)
            {
                instanceCount = 0;
            }
            else
            {
                try
                {
                    instanceCount = ((filterInfo.Operator != Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.BottomPercent) ? ((int)Math.Ceiling(num)) : ((int)Math.Floor(num)));
                }
                catch (Exception e)
                {
                    if (AsynchronousExceptionDetection.IsStoppingException(e))
                    {
                        throw;
                    }
                    throw new ReportProcessingException(ErrorCode.rsFilterEvaluationError, "FilterValues");
                }
            }
            filterInfo.TrimInstanceSet(instanceCount);
        }
Esempio n. 2
0
 internal FieldImpl this[int index]
 {
     get
     {
         ValidateFieldCollection();
         try
         {
             FieldImpl obj = m_collection[index];
             obj.UsedInExpression = true;
             return(obj);
         }
         catch (RSException)
         {
             throw;
         }
         catch (Exception e)
         {
             if (AsynchronousExceptionDetection.IsStoppingException(e))
             {
                 throw;
             }
             throw new ReportProcessingException_NonExistingFieldReference();
         }
     }
     set
     {
         Global.Tracer.Assert(m_collection != null);
         m_collection[index] = value;
     }
 }
        private object GetFieldValue(string stringValue, MapDataType dataType)
        {
            try
            {
                switch (dataType)
                {
                case MapDataType.Boolean:
                    return(Convert.ToBoolean(stringValue, CultureInfo.InvariantCulture));

                case MapDataType.DateTime:
                    return(Convert.ToDateTime(stringValue, CultureInfo.InvariantCulture));

                case MapDataType.Float:
                    return(Convert.ToDouble(stringValue, CultureInfo.InvariantCulture));

                case MapDataType.Integer:
                    return(Convert.ToInt32(stringValue, CultureInfo.InvariantCulture));

                case MapDataType.Decimal:
                    return(Convert.ToDecimal(stringValue, CultureInfo.InvariantCulture));

                default:
                    return(stringValue);
                }
            }
            catch (Exception ex)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(ex))
                {
                    throw;
                }
                Global.Tracer.Trace(TraceLevel.Verbose, ex.Message);
                return(null);
            }
        }
Esempio n. 4
0
 protected void CancelCommand()
 {
     if (m_commandWrappedForCancel == null)
     {
         return;
     }
     try
     {
         m_executionMetrics.StartTimer(DataProcessingMetrics.MetricType.CancelCommand);
         m_commandWrappedForCancel.Cancel();
         m_executionMetrics.RecordTimerMeasurementWithUpdatedTotal(DataProcessingMetrics.MetricType.CancelCommand);
     }
     catch (RSException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         Global.Tracer.Trace(TraceLevel.Warning, "Error occurred while canceling the command for DataSet '" + m_dataSet.Name.MarkAsPrivate() + "'. Details: " + ex2.ToString());
     }
 }
 public FieldImpl this[int index]
 {
     get
     {
         this.ValidateFieldCollection();
         try
         {
             FieldImpl fieldImpl = this.m_collection[index];
             fieldImpl.UsedInExpression = true;
             return(fieldImpl);
         }
         catch (RSException)
         {
             throw;
         }
         catch (Exception e)
         {
             if (AsynchronousExceptionDetection.IsStoppingException(e))
             {
                 throw;
             }
             throw new ReportProcessingException_NonExistingFieldReference();
         }
     }
     set
     {
         Global.Tracer.Assert(null != this.m_collection);
         this.m_collection[index] = value;
     }
 }
 public bool Render(OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         this.ParseParameters(deviceInfo);
         Stream outputStream = createAndRegisterStream(report.Name, "rpl", null, "application/octet-stream", false, StreamOper.CreateAndRegister);
         SPBProcessing.SPBProcessing sPBProcessing = null;
         using (sPBProcessing = new SPBProcessing.SPBProcessing(report, createAndRegisterStream, true, this.m_rplVersion, ref renderProperties))
         {
             sPBProcessing.SetContext(this.m_spbContext);
             sPBProcessing.GetNextPage(outputStream);
             sPBProcessing.UpdateRenderProperties(ref renderProperties);
         }
         return(false);
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, true);
     }
 }
        internal override Stream Upgrade(Stream definitionStream)
        {
            Stream stream = RDLUpgrader.UpgradeToCurrent(definitionStream, m_throwUpgradeException, m_renameInvalidDataSources);

            if (definitionStream != stream)
            {
                definitionStream.Close();
                definitionStream = null;
                if (Global.Tracer.TraceVerbose)
                {
                    try
                    {
                        StreamReader streamReader = new StreamReader(stream);
                        Global.Tracer.Trace(TraceLevel.Verbose, "Upgraded Report Definition\r\n");
                        Global.Tracer.Trace(TraceLevel.Verbose, streamReader.ReadToEnd());
                        Global.Tracer.Trace(TraceLevel.Verbose, "\r\n");
                        stream.Seek(0L, SeekOrigin.Begin);
                        return(stream);
                    }
                    catch (Exception e)
                    {
                        if (AsynchronousExceptionDetection.IsStoppingException(e))
                        {
                            throw;
                        }
                        return(stream);
                    }
                }
            }
            return(stream);
        }
Esempio n. 8
0
 internal static void DisposeDataExtensionObject <T>(ref T obj, string objectType, string dataSetName, DataProcessingMetrics executionMetrics, DataProcessingMetrics.MetricType?metricType) where T : class, IDisposable
 {
     if (obj == null)
     {
         return;
     }
     if (metricType.HasValue)
     {
         executionMetrics.StartTimer(metricType.Value);
     }
     try
     {
         obj.Dispose();
     }
     catch (RSException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         Global.Tracer.Trace(TraceLevel.Warning, "Error occurred while disposing the " + objectType + " for DataSet '" + dataSetName.MarkAsPrivate() + "'. Details: " + ex2.ToString());
     }
     finally
     {
         obj = null;
         if (metricType.HasValue)
         {
             executionMetrics.RecordTimerMeasurementWithUpdatedTotal(metricType.Value);
         }
     }
 }
Esempio n. 9
0
 public override Field this[string key]
 {
     get
     {
         if (key == null)
         {
             throw new ReportProcessingException_NonExistingFieldReference();
         }
         ValidateFieldCollection();
         try
         {
             FieldImpl obj = m_collection[(int)m_nameMap[key]];
             obj.UsedInExpression = true;
             return(obj);
         }
         catch (RSException)
         {
             throw;
         }
         catch (Exception e)
         {
             if (AsynchronousExceptionDetection.IsStoppingException(e))
             {
                 throw;
             }
             throw new ReportProcessingException_NonExistingFieldReference();
         }
     }
 }
Esempio n. 10
0
        private bool TakeOwnershipFromExistingQuery(ExecutedQuery query)
        {
            IDataReader dataReader = null;

            try
            {
                m_executionMetrics.Add(query.ExecutionMetrics);
                m_executionMetrics.CommandText = query.ExecutionMetrics.CommandText;
                query.ReleaseOwnership(ref m_command, ref m_commandWrappedForCancel, ref dataReader);
                ExtractRewrittenCommandText(m_command);
                StoreDataReader(dataReader, query.ErrorInspector);
                return(ReaderExtensionsSupported(dataReader));
            }
            catch (RSException)
            {
                EagerInlineReaderCleanup(ref dataReader);
                throw;
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                EagerInlineReaderCleanup(ref dataReader);
                throw;
            }
        }
Esempio n. 11
0
 private void Process(ExecutedQuery existingQuery)
 {
     InitializeDataSet();
     try
     {
         try
         {
             InitializeRowSourceAndProcessRows(existingQuery);
         }
         finally
         {
             CleanupProcess();
         }
         AllRowsRead();
         TeardownDataSet();
     }
     catch (RSException)
     {
         throw;
     }
     catch (Exception e)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(e))
         {
             throw;
         }
         CleanupForException();
         throw;
     }
     finally
     {
         FinalCleanup();
     }
 }
 public static void AddGroupNameValuePair(OnDemandProcessingContext odpContext, AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping, Dictionary <string, object> nameValuePairs)
 {
     if (grouping != null)
     {
         Global.Tracer.Assert(grouping.GroupExpressions != null && 0 < grouping.GroupExpressions.Count);
         AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
         if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
         {
             try
             {
                 FieldImpl fieldImpl = odpContext.ReportObjectModel.FieldsImpl[expressionInfo.IntValue];
                 if (fieldImpl.FieldDef != null)
                 {
                     object value = fieldImpl.Value;
                     if (!nameValuePairs.ContainsKey(fieldImpl.FieldDef.DataField))
                     {
                         nameValuePairs.Add(fieldImpl.FieldDef.DataField, (value is DBNull) ? null : value);
                     }
                 }
             }
             catch (Exception e)
             {
                 if (!AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     goto end_IL_0097;
                 }
                 throw;
                 end_IL_0097 :;
             }
         }
     }
 }
Esempio n. 13
0
        protected IDataReader RunLiveQuery(List <Microsoft.ReportingServices.ReportIntermediateFormat.ParameterValue> queryParams, object[] paramValues)
        {
            IDataReader reader     = null;
            IDbCommand  command    = null;
            IJobContext jobContext = m_odpContext.JobContext;

            if (m_dataSourceConnection == null)
            {
                m_dataSourceConnection = RuntimeDataSource.OpenConnection(m_dataSource, m_dataSet, m_odpContext, m_executionMetrics);
            }
            try
            {
                m_executionMetrics.StartTimer(DataProcessingMetrics.MetricType.Query);
                command = CreateCommand();
                SetCommandParameters(command, queryParams, paramValues);
                string commandText = SetCommandText(command);
                StoreCommandText(commandText);
                SetCommandType(command);
                SetTransaction(command);
                m_odpContext.CheckAndThrowIfAborted();
                SetCommandTimeout(command);
                ExtractRewrittenCommandText(command);
                SetRestartPosition(command);
                DataSourceInfo dataSourceInfo = null;
                if (command is IDbImpersonationNeededForCommandCancel)
                {
                    dataSourceInfo = m_dataSource.GetDataSourceInfo(m_odpContext);
                }
                m_command = command;
                m_commandWrappedForCancel = new CommandWrappedForCancel(m_command, m_odpContext.CreateAndSetupDataExtensionFunction, m_dataSource, dataSourceInfo, m_dataSet.Name, m_dataSourceConnection);
                if (jobContext != null)
                {
                    jobContext.SetAdditionalCorrelation(m_command);
                    jobContext.ApplyCommandMemoryLimit(m_command);
                }
                DataSourceErrorInspector errorInspector = CreateErrorInspector();
                reader = ExecuteReader(jobContext, errorInspector, commandText);
                StoreDataReader(reader, errorInspector);
                return(reader);
            }
            catch (RSException)
            {
                EagerInlineCommandAndReaderCleanup(ref reader, ref command);
                throw;
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                EagerInlineCommandAndReaderCleanup(ref reader, ref command);
                throw;
            }
            finally
            {
                m_executionMetrics.RecordTimerMeasurement(DataProcessingMetrics.MetricType.Query);
            }
        }
Esempio n. 14
0
        private void InitializeEnvironment()
        {
            this.m_report = base.m_romReport.RenderReport.ReportDef;
            AspNetCore.ReportingServices.ReportProcessing.ReportInstance  reportInstance   = base.m_romReport.RenderReport.ReportInstance;
            AspNetCore.ReportingServices.ReportRendering.RenderingContext renderingContext = base.m_romReport.RenderReport.RenderingContext;
            ReportSnapshot     reportSnapshot     = renderingContext.ReportSnapshot;
            ReportInstanceInfo reportInstanceInfo = (ReportInstanceInfo)reportInstance.GetInstanceInfo(renderingContext.ChunkManager);

            this.m_processingContext = new AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ProcessingContext(renderingContext.TopLevelReportContext, this.m_report.ShowHideType, renderingContext.GetResourceCallback, this.m_report.EmbeddedImages, this.m_report.ImageStreamNames, new ProcessingErrorContext(), !this.m_report.PageMergeOnePass, renderingContext.AllowUserProfileState, renderingContext.ReportRuntimeSetup, renderingContext.DataProtection);
            this.m_reportCulture     = Localization.DefaultReportServerSpecificCulture;
            if (this.m_report.Language != null)
            {
                string text = null;
                text = ((this.m_report.Language.Type != ExpressionInfo.Types.Constant) ? reportInstance.Language : this.m_report.Language.Value);
                if (text != null)
                {
                    try
                    {
                        this.m_reportCulture = new CultureInfo(text, false);
                        if (this.m_reportCulture.IsNeutralCulture)
                        {
                            this.m_reportCulture = CultureInfo.CreateSpecificCulture(text);
                            this.m_reportCulture = new CultureInfo(this.m_reportCulture.Name, false);
                        }
                    }
                    catch (Exception e)
                    {
                        if (!AsynchronousExceptionDetection.IsStoppingException(e))
                        {
                            goto end_IL_0140;
                        }
                        throw;
                        end_IL_0140 :;
                    }
                }
            }
            this.m_processingContext.ReportObjectModel = new ObjectModelImpl(this.m_processingContext);
            Global.Tracer.Assert(this.m_processingContext.ReportRuntime == null, "(m_processingContext.ReportRuntime == null)");
            this.m_processingContext.ReportRuntime = new ReportRuntime(this.m_processingContext.ReportObjectModel, this.m_processingContext.ErrorContext);
            this.m_processingContext.ReportObjectModel.FieldsImpl      = new FieldsImpl();
            this.m_processingContext.ReportObjectModel.ParametersImpl  = new ParametersImpl(reportInstanceInfo.Parameters.Count);
            this.m_processingContext.ReportObjectModel.GlobalsImpl     = new GlobalsImpl(reportInstanceInfo.ReportName, base.m_currentPageNumber, base.m_totalPages, reportSnapshot.ExecutionTime, reportSnapshot.ReportServerUrl, reportSnapshot.ReportFolder);
            this.m_processingContext.ReportObjectModel.UserImpl        = new UserImpl(reportSnapshot.RequestUserName, reportSnapshot.Language, this.m_processingContext.AllowUserProfileState);
            this.m_processingContext.ReportObjectModel.DataSetsImpl    = new DataSetsImpl();
            this.m_processingContext.ReportObjectModel.DataSourcesImpl = new DataSourcesImpl(this.m_report.DataSourceCount);
            for (int i = 0; i < reportInstanceInfo.Parameters.Count; i++)
            {
                this.m_processingContext.ReportObjectModel.ParametersImpl.Add(reportInstanceInfo.Parameters[i].Name, new ParameterImpl(reportInstanceInfo.Parameters[i].Values, reportInstanceInfo.Parameters[i].Labels, reportInstanceInfo.Parameters[i].MultiValue));
            }
            this.m_processingContext.ReportRuntime.LoadCompiledCode(this.m_report, false, this.m_processingContext.ReportObjectModel, this.m_processingContext.ReportRuntimeSetup);
        }
Esempio n. 15
0
 private object GetEndValue(Type fieldType)
 {
     if (!m_endValueEvaluated)
     {
         if (GetDistributionType() == MapRuleDistributionType.Custom)
         {
             MapBucketCollection mapBuckets = m_mapRule.MapBuckets;
             if (mapBuckets != null && mapBuckets.Count > 0)
             {
                 ReportVariantProperty endValue = mapBuckets[mapBuckets.Count - 1].EndValue;
                 if (endValue != null)
                 {
                     if (!endValue.IsExpression)
                     {
                         m_endValue = endValue.Value;
                     }
                     m_endValue = mapBuckets[mapBuckets.Count - 1].Instance.EndValue;
                 }
             }
         }
         if (m_endValue == null)
         {
             ReportVariantProperty endValue2 = m_mapRule.EndValue;
             if (endValue2 != null)
             {
                 if (!endValue2.IsExpression)
                 {
                     m_endValue = endValue2.Value;
                 }
                 m_endValue = m_mapRule.Instance.EndValue;
             }
         }
         if (m_endValue != null)
         {
             try
             {
                 m_endValue = Convert.ChangeType(m_endValue, fieldType, CultureInfo.InvariantCulture);
             }
             catch (Exception e)
             {
                 if (AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     throw;
                 }
                 m_endValue = null;
             }
         }
         m_endValueEvaluated = true;
     }
     return(m_endValue);
 }
Esempio n. 16
0
 private object GetStartValue(Type fieldType)
 {
     if (!this.m_startValueEvaluated)
     {
         if (this.GetDistributionType() == MapRuleDistributionType.Custom)
         {
             MapBucketCollection mapBuckets = this.m_mapRule.MapBuckets;
             if (mapBuckets != null && mapBuckets.Count > 0)
             {
                 ReportVariantProperty startValue = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[0].StartValue;
                 if (startValue != null)
                 {
                     if (!startValue.IsExpression)
                     {
                         this.m_startValue = startValue.Value;
                     }
                     this.m_startValue = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[0].Instance.StartValue;
                 }
             }
         }
         if (this.m_startValue == null)
         {
             ReportVariantProperty startValue2 = this.m_mapRule.StartValue;
             if (startValue2 != null)
             {
                 if (!startValue2.IsExpression)
                 {
                     this.m_startValue = startValue2.Value;
                 }
                 this.m_startValue = this.m_mapRule.Instance.StartValue;
             }
         }
         if (this.m_startValue != null)
         {
             try
             {
                 this.m_startValue = Convert.ChangeType(this.m_startValue, fieldType, CultureInfo.InvariantCulture);
             }
             catch (Exception e)
             {
                 if (AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     throw;
                 }
                 this.m_startValue = null;
             }
         }
         this.m_startValueEvaluated = true;
     }
     return(this.m_startValue);
 }
 internal void AddFieldValue(ISpatialElement spatialElement, string fieldName, object value)
 {
     try
     {
         spatialElement[fieldName] = value;
     }
     catch (Exception e)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(e))
         {
             throw;
         }
         spatialElement[fieldName] = value.ToString();
         m_mapVectorLayer.MapDef.RenderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsMapUnsupportedValueFieldType, Severity.Warning, m_mapVectorLayer.MapDef.MapDef.ObjectType, m_mapVectorLayer.MapDef.Name, m_mapVectorLayer.Name, fieldName);
     }
 }
Esempio n. 18
0
 internal ChartMember GetChartMember(ChartSeries chartSeries)
 {
     try
     {
         int memberCellIndex = m_chartSeriesCollection.IndexOf(chartSeries);
         return(GetChartMember(m_seriesMembers, memberCellIndex));
     }
     catch (Exception e)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(e))
         {
             throw;
         }
         return(null);
     }
 }
        internal DataValue GetDataValue(string propertyName)
        {
            DataValueCollection dataValues = ((ShimChartDataPoint)m_dataPoint).DataValues;

            try
            {
                return(dataValues[propertyName]);
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                return(null);
            }
        }
        internal static IRenderingExtension GetNewRenderer(string format, IExtensionFactory extFactory)
        {
            IRenderingExtension renderingExtension = null;

            try
            {
                return((IRenderingExtension)extFactory.GetNewRendererExtensionClass(format));
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                throw new ReportProcessingException(ErrorCode.rsRenderingExtensionNotFound);
            }
        }
Esempio n. 21
0
 public void GetRenderingResource(CreateAndRegisterStream createAndRegisterStreamCallback, NameValueCollection deviceInfo)
 {
     try
     {
         ROMReport.GetRenderingResource(createAndRegisterStreamCallback, deviceInfo["GetImage"]);
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, unexpected: true);
     }
 }
Esempio n. 22
0
 private FieldImpl CheckedGetFieldByIndex(int index)
 {
     try
     {
         if (m_collection[index] == null || m_collection[index].IsCalculatedField)
         {
             m_reportOM.PerformPendingFieldValueUpdate();
         }
         return(m_collection[index]);
     }
     catch (Exception e)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(e))
         {
             throw;
         }
         throw new ReportProcessingException_NonExistingFieldReference();
     }
 }
Esempio n. 23
0
 public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         ParseDeviceInfo(ref deviceInfo);
         Render(report, deviceInfo, renderProperties, createAndRegisterStream);
         return(true);
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, unexpected: true);
     }
 }
Esempio n. 24
0
 public bool RenderStream(string streamName, Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         deviceInfo             = ((deviceInfo == null) ? new NameValueCollection() : deviceInfo);
         reportServerParameters = ((reportServerParameters == null) ? new NameValueCollection() : reportServerParameters);
         clientCapabilities     = ((clientCapabilities == null) ? new NameValueCollection() : clientCapabilities);
         return(InternalRenderStream(streamName, report, reportServerParameters, deviceInfo, clientCapabilities, ref renderProperties, createAndRegisterStream));
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, unexpected: true);
     }
 }
Esempio n. 25
0
        private System.Drawing.Image[,] LoadTilesHandler(Layer layer, string[,] tileUrls)
        {
            System.Drawing.Image[,] array = null;
            int          num    = tileUrls.GetUpperBound(0) + 1;
            int          num2   = tileUrls.GetUpperBound(1) + 1;
            MapTileLayer layer2 = this.GetLayer(layer.Name);

            try
            {
                for (int i = 0; i < num; i++)
                {
                    for (int j = 0; j < num2; j++)
                    {
                        System.Drawing.Image image = (!this.Embedded(layer2)) ? this.GetSnapshotTile(layer2, tileUrls[i, j]) : this.GetEmbeddedTile(layer2, tileUrls[i, j]);
                        if (image == null)
                        {
                            this.DisposeTiles(array, num, num2);
                            return(null);
                        }
                        if (array == null)
                        {
                            array = new System.Drawing.Image[num, num2];
                        }
                        array[i, j] = image;
                    }
                }
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                this.DisposeTiles(array, num, num2);
                return(null);
            }
            this.m_success = (array != null);
            return(array);
        }
Esempio n. 26
0
 public override Parameter this[string key]
 {
     get
     {
         if (key == null || m_nameMap == null || m_collection == null)
         {
             throw new ReportProcessingException_NonExistingParameterReference(key);
         }
         try
         {
             return(m_collection[(int)m_nameMap[key]]);
         }
         catch (Exception e)
         {
             if (AsynchronousExceptionDetection.IsStoppingException(e))
             {
                 throw;
             }
             throw new ReportProcessingException_NonExistingParameterReference(key);
         }
     }
 }
        public static IDbConnection OpenConnection(AspNetCore.ReportingServices.ReportIntermediateFormat.DataSource dataSourceObj, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics)
        {
            IDbConnection dbConnection = null;

            try
            {
                metrics.StartTimer(DataProcessingMetrics.MetricType.OpenConnection);
                DataSourceInfo dataSourceInfo = null;
                string         text           = dataSourceObj.ResolveConnectionString(pc, out dataSourceInfo);
                if (pc.UseVerboseExecutionLogging)
                {
                    metrics.ResolvedConnectionString = text;
                }
                //if (pc.CreateAndSetupDataExtensionFunction.MustResolveSharedDataSources)
                //{

                //}

                return(pc.CreateAndSetupDataExtensionFunction.OpenDataSourceExtensionConnection(dataSourceObj, text, dataSourceInfo, dataSetObj.Name));
            }
            catch (RSException)
            {
                throw;
            }
            catch (Exception ex2)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(ex2))
                {
                    throw;
                }
                throw new ReportProcessingException(ErrorCode.rsErrorOpeningConnection, ex2, dataSourceObj.Name);
            }
            finally
            {
                long num = metrics.RecordTimerMeasurementWithUpdatedTotal(DataProcessingMetrics.MetricType.OpenConnection);
                Global.Tracer.Trace(TraceLevel.Verbose, "Opening a connection for DataSource: {0} took {1} ms.", dataSourceObj.Name.MarkAsModelInfo(), num);
            }
        }
 public bool RenderStream(string streamName, AspNetCore.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         if (string.IsNullOrEmpty(streamName))
         {
             return(false);
         }
         return(SPBProcessing.SPBProcessing.RenderSecondaryStream(report, createAndRegisterStream, streamName));
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, true);
     }
 }
Esempio n. 29
0
 protected void ShutdownSequentialReadersAndIdcDataManagers()
 {
     if (this.m_sequentialDataReadersAndIdcDataManagers != null)
     {
         for (int i = 0; i < this.m_sequentialDataReadersAndIdcDataManagers.Count; i++)
         {
             try
             {
                 this.m_sequentialDataReadersAndIdcDataManagers[i].Dispose();
             }
             catch (ReportProcessingException ex)
             {
                 if (ex.InnerException != null && AsynchronousExceptionDetection.IsStoppingException(ex.InnerException))
                 {
                     throw;
                 }
                 Global.Tracer.Trace(TraceLevel.Error, "Error cleaning up request: {0}", ex);
             }
         }
         this.m_sequentialDataReadersAndIdcDataManagers = null;
         this.m_idcDataManagers = null;
     }
 }
        public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable someProps, CreateAndRegisterStream createAndRegisterStream)
        {
            double pageHeight = double.MaxValue;

            using (Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, pageHeight))
            {
                DeviceInfo deviceInfo2 = new DeviceInfo(deviceInfo);
                SPBContext sPBContext  = new SPBContext();
                sPBContext.StartPage                = 0;
                sPBContext.EndPage                  = 0;
                sPBContext.MeasureItems             = false;
                sPBContext.AddSecondaryStreamNames  = true;
                sPBContext.AddToggledItems          = deviceInfo2.ExpandToggles;
                sPBContext.AddFirstPageHeaderFooter = true;
                sPBProcessing.SetContext(sPBContext);
                using (IWordWriter writer = NewWordWriter())
                {
                    WordRenderer wordRenderer = NewWordRenderer(createAndRegisterStream, deviceInfo2, sPBProcessing, writer, report.Name);
                    try
                    {
                        return(wordRenderer.Render());
                    }
                    catch (ReportRenderingException)
                    {
                        throw;
                    }
                    catch (Exception ex2)
                    {
                        if (AsynchronousExceptionDetection.IsStoppingException(ex2))
                        {
                            throw;
                        }
                        throw new ReportRenderingException(ex2, unexpected: true);
                    }
                }
            }
        }