예제 #1
0
 private bool GetExternalImage(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext, string path, out byte[] imageData, out string mimeType)
 {
     imageData = null;
     mimeType  = null;
     try
     {
         if (!renderingContext.OdpContext.TopLevelContext.ReportContext.IsSupportedProtocol(path, true))
         {
             renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsUnsupportedProtocol, Severity.Error, base.m_image.ObjectType, base.m_image.ObjectName, base.m_image.ImageDataPropertyName, path, "http://, https://, ftp://, file:, mailto:, or news:");
         }
         else
         {
             bool flag = default(bool);
             renderingContext.OdpContext.GetResource(path, out imageData, out mimeType, out flag);
             if (imageData != null && !AspNetCore.ReportingServices.ReportPublishing.Validator.ValidateMimeType(mimeType))
             {
                 renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidMIMEType, Severity.Warning, base.m_image.ObjectType, base.m_image.ObjectName, "MIMEType", mimeType);
                 mimeType  = null;
                 imageData = null;
             }
             if (flag)
             {
                 renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsSandboxingExternalResourceExceedsMaximumSize, Severity.Warning, base.m_image.ObjectType, base.m_image.ObjectName, base.m_image.ImageDataPropertyName);
             }
         }
     }
     catch (Exception ex)
     {
         renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidImageReference, Severity.Warning, base.m_image.ObjectType, base.m_image.ObjectName, base.m_image.ImageDataPropertyName, ex.Message);
         return(false);
     }
     return(true);
 }
        public string GetFileStreamName(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext, string url)
        {
            string           text          = null;
            OnDemandMetadata odpMetadata   = renderingContext.OdpContext.OdpMetadata;
            ShapefileInfo    shapefileInfo = default(ShapefileInfo);

            if (odpMetadata.TryGetShapefile(url, out shapefileInfo))
            {
                if (shapefileInfo.ErrorOccurred)
                {
                    return(null);
                }
                text = shapefileInfo.StreamName;
            }
            else
            {
                byte[] array = default(byte[]);
                if (!this.GetFileData(renderingContext, url, out array) || array == null)
                {
                    shapefileInfo = new ShapefileInfo(null);
                    shapefileInfo.ErrorOccurred = true;
                }
                else
                {
                    text          = this.StoreShapefileInChunk(renderingContext, array);
                    shapefileInfo = new ShapefileInfo(text);
                }
                odpMetadata.AddShapefile(url, shapefileInfo);
            }
            return(text);
        }
예제 #3
0
 private void FinallyBlockForProcessingAndRendering(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext, ExecutionLogContext executionLogContext)
 {
     if (odpRenderingContext != null)
     {
         odpRenderingContext.CloseRenderingChunkManager();
     }
     executionLogContext.StopRenderingTimer();
 }
예제 #4
0
 private void UpdateEventInfo(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext, RenderingContext rc, ref bool eventInfoChanged)
 {
     this.UpdateEventInfoInSnapshot();
     eventInfoChanged |= odpRenderingContext.EventInfoChanged;
     if (eventInfoChanged)
     {
         rc.EventInfo = odpRenderingContext.EventInfo;
     }
 }
        private string StoreShapefileInChunk(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext, byte[] data)
        {
            string        text         = Guid.NewGuid().ToString("N");
            IChunkFactory chunkFactory = renderingContext.OdpContext.ChunkFactory;

            using (Stream stream = chunkFactory.CreateChunk(text, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Shapefile, null))
            {
                stream.Write(data, 0, data.Length);
                return(text);
            }
        }
예제 #6
0
        public void SetTileData(string url, byte[] data, string mimeType, AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext)
        {
            string    text      = Guid.NewGuid().ToString("N");
            ImageInfo imageInfo = new ImageInfo(text, "");

            renderingContext.OdpContext.OdpMetadata.AddExternalImage(url, imageInfo);
            IChunkFactory chunkFactory = renderingContext.OdpContext.ChunkFactory;

            using (Stream stream = chunkFactory.CreateChunk(text, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Image, mimeType))
            {
                stream.Write(data, 0, data.Length);
            }
        }
예제 #7
0
        public Stream GetTileData(string url, out string mimeType, AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext)
        {
            OnDemandMetadata odpMetadata = renderingContext.OdpContext.OdpMetadata;
            ImageInfo        imageInfo   = default(ImageInfo);

            if (odpMetadata.TryGetExternalImage(url, out imageInfo))
            {
                IChunkFactory chunkFactory = renderingContext.OdpContext.ChunkFactory;
                return(chunkFactory.GetChunk(imageInfo.StreamName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Image, ChunkMode.Open, out mimeType));
            }
            mimeType = null;
            return(null);
        }
예제 #8
0
        public static bool ComputeHidden(IVisibilityOwner visibilityOwner, AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext, ToggleCascadeDirection direction, out bool valueIsDeep)
        {
            valueIsDeep = false;
            bool       flag       = false;
            Visibility visibility = visibilityOwner.Visibility;

            if (visibility != null)
            {
                switch (Visibility.GetSharedHidden(visibility))
                {
                case SharedHiddenState.Always:
                    flag = true;
                    break;

                case SharedHiddenState.Never:
                    flag = false;
                    break;

                case SharedHiddenState.Sometimes:
                    flag = visibilityOwner.ComputeStartHidden(renderingContext);
                    if (visibility.IsToggleReceiver)
                    {
                        TextBox toggleSender = visibility.ToggleSender;
                        Global.Tracer.Assert(toggleSender != null, "Missing Persisted Toggle Receiver -> Sender Link");
                        string senderUniqueName = visibilityOwner.SenderUniqueName;
                        if (senderUniqueName != null && renderingContext.IsSenderToggled(senderUniqueName))
                        {
                            flag = !flag;
                        }
                        if (!flag)
                        {
                            flag = Visibility.ComputeDeepHidden(flag, visibilityOwner, direction, renderingContext);
                        }
                        valueIsDeep = true;
                    }
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
            return(flag);
        }
예제 #9
0
        protected override string CalculateImageProperties(out string mimeType, out byte[] imageData, out string imageDataId, out List <string> fieldsUsedInValue, out bool isNullImage)
        {
            isNullImage = false;
            bool   flag          = default(bool);
            string valueAsString = base.m_image.GetValueAsString(out fieldsUsedInValue, out flag);

            if (flag)
            {
                return(base.GetErrorImageProperties(out mimeType, out imageData, out imageDataId));
            }
            if (string.IsNullOrEmpty(valueAsString))
            {
                isNullImage = true;
                return(base.GetTransparentImageProperties(out mimeType, out imageData, out imageDataId));
            }
            AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext = base.m_reportElement.RenderingContext;
            string text = null;

            imageData   = null;
            imageDataId = valueAsString;
            bool flag2 = default(bool);

            if (base.CacheManager.TryGetExternalImage(valueAsString, out imageData, out mimeType, out text, out flag2))
            {
                if (flag2)
                {
                    imageDataId = null;
                }
            }
            else if (!this.GetExternalImage(renderingContext, valueAsString, out imageData, out mimeType) || imageData == null)
            {
                renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidExternalImageProperty, Severity.Warning, base.m_image.ObjectType, base.m_image.ObjectName, base.m_image.ImageDataPropertyName, text);
                base.CacheManager.AddFailedExternalImage(valueAsString);
                text        = null;
                imageDataId = null;
            }
            else
            {
                text = base.CacheManager.AddExternalImage(valueAsString, imageData, mimeType);
            }
            return(text);
        }
예제 #10
0
        private bool GetFileData(AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext, string url, out byte[] data)
        {
            data = null;
            string text = null;

            try
            {
                bool flag = default(bool);
                if (!renderingContext.OdpContext.TopLevelContext.ReportContext.IsSupportedProtocol(url, true, out flag))
                {
                    renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsUnsupportedProtocol, Severity.Error, base.m_map.ObjectType, base.m_map.Name, "Source", url, "http://, https://, ftp://, file:, mailto:, or news:");
                    return(false);
                }
                bool flag2 = default(bool);
                renderingContext.OdpContext.GetResource(url, out data, out text, out flag2);
                return(data != null);
            }
            catch (Exception ex)
            {
                renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsMapInvalidShapefileReference, Severity.Warning, base.m_map.ObjectType, base.m_map.Name, url, ex.Message);
                return(false);
            }
        }
예제 #11
0
 public Image(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, bool inSubtotal, AspNetCore.ReportingServices.ReportRendering.Image renderImage, RenderingContext renderingContext)
     : base(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, renderImage, renderingContext)
 {
     this.m_renderImage = renderImage;
 }
예제 #12
0
 public InternalParagraph(TextBox textBox, int indexIntoParentCollectionDef, AspNetCore.ReportingServices.ReportIntermediateFormat.Paragraph paragraph, RenderingContext renderingContext)
     : base(textBox, indexIntoParentCollectionDef, renderingContext)
 {
     this.m_paragraphDef = paragraph;
 }
예제 #13
0
        public static bool ComputeDeepHidden(bool hidden, IVisibilityOwner visibilityOwner, ToggleCascadeDirection direction, AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext renderingContext)
        {
            Visibility visibility = visibilityOwner.Visibility;

            if (hidden && (visibility == null || !visibility.IsToggleReceiver))
            {
                hidden = false;
            }
            if (!hidden && visibility != null && visibility.IsToggleReceiver)
            {
                hidden = ((!visibility.RecursiveReceiver || !(visibilityOwner is TablixMember)) ? (hidden | visibility.ToggleSender.ComputeDeepHidden(renderingContext, direction)) : (hidden | ((TablixMember)visibilityOwner).ComputeToggleSenderDeepHidden(renderingContext)));
            }
            if (!hidden && (visibility == null || !visibility.RecursiveReceiver) && visibilityOwner.ContainingDynamicVisibility != null)
            {
                hidden |= visibilityOwner.ContainingDynamicVisibility.ComputeDeepHidden(renderingContext, direction);
            }
            if (!hidden && direction != ToggleCascadeDirection.Column && visibilityOwner.ContainingDynamicRowVisibility != null)
            {
                hidden |= visibilityOwner.ContainingDynamicRowVisibility.ComputeDeepHidden(renderingContext, direction);
            }
            if (!hidden && direction != ToggleCascadeDirection.Row && visibilityOwner.ContainingDynamicColumnVisibility != null)
            {
                hidden |= visibilityOwner.ContainingDynamicColumnVisibility.ComputeDeepHidden(renderingContext, direction);
            }
            return(hidden);
        }
예제 #14
0
 public Paragraph(TextBox textBox, int indexIntoParentCollectionDef, RenderingContext renderingContext)
     : base(textBox.ReportScope, textBox, textBox.ReportItemDef, renderingContext)
 {
     this.m_textBox = textBox;
     this.m_indexIntoParentCollectionDef = indexIntoParentCollectionDef;
 }
예제 #15
0
 public Chart(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, AspNetCore.ReportingServices.ReportIntermediateFormat.Chart reportItemDef, RenderingContext renderingContext)
     : base(parentDefinitionPath, indexIntoParentCollectionDef, reportItemDef, renderingContext)
 {
 }
예제 #16
0
 protected override AspNetCore.ReportingServices.OnDemandReportRendering.Report PrepareROM(out AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext)
 {
     odpRenderingContext = new AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext(base.PublicRenderingContext.Format, base.m_reportSnapshot, base.PublicProcessingContext.ChunkFactory, base.PublicRenderingContext.EventInfo);
     odpRenderingContext.InstanceAccessDisallowed = true;
     return(new AspNetCore.ReportingServices.OnDemandReportRendering.Report(base.m_reportSnapshot.Report, base.m_reportSnapshot.ReportInstance, base.m_renderingContext, odpRenderingContext, base.ReportName, base.PublicRenderingContext.ReportDescription));
 }
예제 #17
0
 protected abstract AspNetCore.ReportingServices.OnDemandReportRendering.Report PrepareROM(out AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext);
 public ReportItemCollection(IDefinitionPath parentDefinitionPath, bool inSubtotal, AspNetCore.ReportingServices.ReportRendering.ReportItemCollection renderReportItemCollection, RenderingContext renderingContext)
 {
     this.m_parentDefinitionPath       = parentDefinitionPath;
     this.m_isOldSnapshot              = true;
     this.m_inSubtotal                 = inSubtotal;
     this.m_renderReportItemCollection = renderReportItemCollection;
     this.m_renderingContext           = renderingContext;
 }
 public ReportItemCollection(IReportScope reportScope, IDefinitionPath parentDefinitionPath, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportItemCollection reportItemColDef, RenderingContext renderingContext)
 {
     this.m_reportScope          = reportScope;
     this.m_parentDefinitionPath = parentDefinitionPath;
     this.m_isOldSnapshot        = false;
     this.m_reportItemColDef     = reportItemColDef;
     this.m_renderingContext     = renderingContext;
 }
예제 #20
0
 public Page(IDefinitionPath parentDefinitionPath, AspNetCore.ReportingServices.ReportRendering.Report renderReport, RenderingContext renderingContext, ReportSection reportSection)
     : base(parentDefinitionPath, renderingContext)
 {
     base.m_isOldSnapshot = true;
     this.m_renderReport  = renderReport;
     this.m_reportSection = reportSection;
 }
예제 #21
0
 public Chart(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, bool inSubtotal, AspNetCore.ReportingServices.ReportRendering.Chart renderChart, RenderingContext renderingContext)
     : base(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, renderChart, renderingContext)
 {
     base.m_snapshotDataRegionType = Type.Chart;
 }
예제 #22
0
        public OnDemandProcessingResult Execute(IRenderingExtension newRenderer)
        {
            ExecutionLogContext executionLogContext = new ExecutionLogContext(this.m_publicProcessingContext.JobContext);

            executionLogContext.StartProcessingTimer();
            ProcessingErrorContext processingErrorContext = new ProcessingErrorContext();
            CultureInfo            currentCulture         = Thread.CurrentThread.CurrentCulture;

            try
            {
                bool                eventInfoChanged       = false;
                bool                renderingInfoChanged   = false;
                UserProfileState    userProfileState       = UserProfileState.None;
                Hashtable           renderProperties       = this.PublicRenderingContext.GetRenderProperties(this.IsSnapshotReprocessing);
                NameValueCollection reportServerParameters = this.FormServerParameterCollection(this.PublicRenderingContext.ReportContext.RSRequestParameters.CatalogParameters);
                this.PrepareForExecution();
                this.ProcessReport(processingErrorContext, executionLogContext, ref userProfileState);
                AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext = null;
                try
                {
                    AspNetCore.ReportingServices.OnDemandReportRendering.Report report = this.PrepareROM(out odpRenderingContext);
                    executionLogContext.StartRenderingTimer();
                    renderingInfoChanged = this.InvokeRenderer(newRenderer, report, reportServerParameters, this.RenderingParameters, this.PublicRenderingContext.ReportContext.RSRequestParameters.BrowserCapabilities, ref renderProperties, this.PublicProcessingContext.CreateStreamCallback);
                    this.UpdateServerTotalPages(newRenderer, ref renderProperties);
                    this.UpdateEventInfo(odpRenderingContext, this.PublicRenderingContext, ref eventInfoChanged);
                }
                catch (ReportProcessing.DataCacheUnavailableException)
                {
                    throw;
                }
                catch (ReportRenderingException rex)
                {
                    ReportProcessing.HandleRenderingException(rex);
                }
                catch (RSException ex)
                {
                    throw;
                }
                catch (Exception ex3)
                {
                    if (AsynchronousExceptionDetection.IsStoppingException(ex3))
                    {
                        throw;
                    }
                    throw new UnhandledReportRenderingException(ex3);
                }
                finally
                {
                    this.FinallyBlockForProcessingAndRendering(odpRenderingContext, executionLogContext);
                }
                this.CleanupSuccessfulProcessing(processingErrorContext);
                return(this.ConstructProcessingResult(eventInfoChanged, renderProperties, processingErrorContext, userProfileState, renderingInfoChanged, executionLogContext));
            }
            catch (ReportProcessing.DataCacheUnavailableException ex)
            {
                throw;
            }
            catch (RSException ex)
            {
                this.CleanupForException();
                throw;
            }
            catch (Exception innerException)
            {
                this.CleanupForException();
                throw new ReportProcessingException(innerException, processingErrorContext.Messages);
            }
            finally
            {
                this.FinalCleanup();
                ReportProcessing.UpdateHostingEnvironment(processingErrorContext, this.PublicProcessingContext.ReportContext, executionLogContext, this.RunningProcessingEngine, this.PublicProcessingContext.JobContext);
                if (currentCulture != null)
                {
                    Thread.CurrentThread.CurrentCulture = currentCulture;
                }
            }
        }
예제 #23
0
 public Paragraph(TextBox textBox, RenderingContext renderingContext)
     : base(textBox, textBox.RenderReportItem, renderingContext)
 {
     this.m_textBox = textBox;
 }
 protected override AspNetCore.ReportingServices.OnDemandReportRendering.Report PrepareROM(out AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext odpRenderingContext)
 {
     odpRenderingContext = new AspNetCore.ReportingServices.OnDemandReportRendering.RenderingContext(base.PublicRenderingContext.Format, this.m_odpReportSnapshot, base.PublicRenderingContext.EventInfo, this.m_odpContext);
     return(new AspNetCore.ReportingServices.OnDemandReportRendering.Report(this.m_odpReportSnapshot.Report, this.m_odpReportSnapshot.ReportInstance, odpRenderingContext, base.ReportName, base.PublicRenderingContext.ReportDescription));
 }
예제 #25
0
 public Image(IReportScope reportScope, IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, AspNetCore.ReportingServices.ReportIntermediateFormat.Image reportItemDef, RenderingContext renderingContext)
     : base(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, reportItemDef, renderingContext)
 {
 }