Example #1
0
        public override void WriteCustomNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;

            System.Drawing.Image image2 = null;
            bool flag = this.AutoSizeImage(pageContext, imageInstance, out image2);

            try
            {
                if (flag)
                {
                    base.WriteImage(null, "InvalidImage", spbifWriter, pageContext, image2);
                }
                else
                {
                    base.WriteImage(imageInstance, null, spbifWriter, pageContext, image2);
                }
            }
            finally
            {
                if (image2 != null)
                {
                    image2.Dispose();
                    image2 = null;
                }
            }
            base.WriteActionInfo(image.ActionInfo, spbifWriter, pageContext, 7);
            base.WriteImageMapAreaInstanceCollection(imageInstance.ActionInfoWithDynamicImageMapAreas, spbifWriter, pageContext);
        }
Example #2
0
 public Image(AspNetCore.ReportingServices.OnDemandReportRendering.Image source, PageContext pageContext, bool createForRepeat)
     : base(source)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             base.m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, false);
         }
         else
         {
             base.m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, false);
         }
     }
     else
     {
         base.m_itemPageSizes = new ItemSizes(source);
     }
     if (source.Sizing == AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize)
     {
         if (base.m_itemPageSizes.Width == 0.0)
         {
             base.m_itemPageSizes.Width = 3.8;
         }
         if (base.m_itemPageSizes.Height == 0.0)
         {
             base.m_itemPageSizes.Height = 4.0;
         }
     }
 }
Example #3
0
 public override void CacheNonSharedProperties(PageContext pageContext)
 {
     if (pageContext.CacheNonSharedProps)
     {
         AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
         this.CheckAutoSize(image, pageContext);
         base.CacheNonSharedProperties(pageContext);
     }
 }
Example #4
0
 private void CheckAutoSize(AspNetCore.ReportingServices.OnDemandReportRendering.Image image, PageContext pageContext)
 {
     if (image.Sizing == AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize)
     {
         ImageInstance        imageInstance = (ImageInstance)image.Instance;
         System.Drawing.Image image2        = null;
         this.m_invalidImage = this.AutoSizeImage(pageContext, imageInstance, out image2);
         if (image2 != null)
         {
             this.m_imageProps = new GDIImageProps(image2);
             image2.Dispose();
         }
     }
 }
Example #5
0
        public override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;
            RPLImageProps rPLImageProps = (RPLImageProps)nonSharedProps;

            if (this.m_invalidImage)
            {
                base.WriteInvalidImage(rPLImageProps, pageContext, this.m_imageProps);
            }
            else
            {
                base.WriteImage(imageInstance, null, rPLImageProps, pageContext, this.m_imageProps);
            }
            rPLImageProps.ActionInfo = PageItem.WriteActionInfo(image.ActionInfo);
        }
Example #6
0
        public override void WriteCustomNonSharedItemProps(BinaryWriter spbifWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;

            if (this.m_invalidImage)
            {
                if (base.m_nonSharedOffset < 0)
                {
                    base.WriteInvalidImage(spbifWriter, pageContext, this.m_imageProps);
                }
            }
            else
            {
                base.WriteImage(imageInstance, null, spbifWriter, pageContext, this.m_imageProps, false);
            }
            base.WriteActionInfo(image.ActionInfo, spbifWriter);
        }
Example #7
0
        public override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;

            System.Drawing.Image gdiImage      = null;
            RPLImageProps        rPLImageProps = (RPLImageProps)nonSharedProps;

            if (this.AutoSizeImage(pageContext, imageInstance, out gdiImage))
            {
                base.WriteImage(null, "InvalidImage", rPLImageProps, pageContext, gdiImage);
            }
            else
            {
                base.WriteImage(imageInstance, null, rPLImageProps, pageContext, gdiImage);
            }
            rPLImageProps.ActionInfo          = base.WriteActionInfo(image.ActionInfo, pageContext);
            rPLImageProps.ActionImageMapAreas = base.WriteImageMapAreaInstanceCollection(imageInstance.ActionInfoWithDynamicImageMapAreas, pageContext);
        }
Example #8
0
        public override void WriteCustomSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            switch (image.Sizing)
            {
            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.Clip:
                spbifWriter.Write((byte)41);
                spbifWriter.Write((byte)3);
                break;

            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.Fit:
                spbifWriter.Write((byte)41);
                spbifWriter.Write((byte)1);
                break;

            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.FitProportional:
                spbifWriter.Write((byte)41);
                spbifWriter.Write((byte)2);
                break;
            }
        }
Example #9
0
        public static string SharedImageStreamName(AspNetCore.ReportingServices.OnDemandReportRendering.Image image, PageContext pageContext)
        {
            ImageInstance imageInstance = (ImageInstance)image.Instance;

            System.Drawing.Image image2 = null;
            Image image3 = new Image(image, pageContext, false);
            bool  flag   = image3.AutoSizeImage(pageContext, imageInstance, out image2);

            if (image2 != null)
            {
                image2.Dispose();
                image2 = null;
            }
            if (flag)
            {
                return("InvalidImage");
            }
            if (imageInstance != null)
            {
                return(imageInstance.StreamName);
            }
            return(null);
        }
Example #10
0
        public override void WriteCustomSharedItemProps(RPLElementPropsDef sharedProps, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            RPLImagePropsDef rPLImagePropsDef = (RPLImagePropsDef)sharedProps;

            switch (image.Sizing)
            {
            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize:
                rPLImagePropsDef.Sizing = RPLFormat.Sizings.AutoSize;
                break;

            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.Clip:
                rPLImagePropsDef.Sizing = RPLFormat.Sizings.Clip;
                break;

            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.Fit:
                rPLImagePropsDef.Sizing = RPLFormat.Sizings.Fit;
                break;

            case AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.FitProportional:
                rPLImagePropsDef.Sizing = RPLFormat.Sizings.FitProportional;
                break;
            }
        }
Example #11
0
 private void DetermineSize(PageContext pageContext)
 {
     if (!this.m_invalidImage && this.m_streamName == null && this.m_imageProps == null)
     {
         AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
         this.CheckAutoSize(image, pageContext);
     }
     if (this.m_imageProps != null)
     {
         this.ResizeImage(pageContext, this.m_imageProps.Width, this.m_imageProps.Height);
     }
     else if (this.m_streamName != null)
     {
         Hashtable autoSizeSharedImages = pageContext.AutoSizeSharedImages;
         if (autoSizeSharedImages != null)
         {
             AutosizeImageProps autosizeImageProps = (AutosizeImageProps)autoSizeSharedImages[this.m_streamName];
             if (autosizeImageProps != null)
             {
                 this.ResizeImage(pageContext, autosizeImageProps.Width, autosizeImageProps.Height);
             }
         }
     }
 }
Example #12
0
 public Image(AspNetCore.ReportingServices.OnDemandReportRendering.Image source)
     : base(source)
 {
     base.m_itemPageSizes = new ItemSizes(source);
 }
Example #13
0
        private bool AutoSizeImage(PageContext pageContext, ImageInstance imageInstance, out System.Drawing.Image gdiImage)
        {
            gdiImage = null;
            if (!pageContext.MeasureItems)
            {
                return(false);
            }
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            if (image.Sizing != 0)
            {
                return(false);
            }
            bool result = false;
            AutosizeImageProps autosizeImageProps = null;
            string             streamName         = imageInstance.StreamName;

            if (streamName != null)
            {
                Hashtable hashtable = pageContext.AutoSizeSharedImages;
                if (hashtable != null)
                {
                    autosizeImageProps = (AutosizeImageProps)hashtable[streamName];
                    if (autosizeImageProps != null)
                    {
                        this.ResizeImage(pageContext, autosizeImageProps.Width, autosizeImageProps.Height);
                        return(autosizeImageProps.InvalidImage);
                    }
                }
                autosizeImageProps = new AutosizeImageProps();
                if (hashtable == null)
                {
                    hashtable = (pageContext.AutoSizeSharedImages = new Hashtable());
                }
                hashtable.Add(streamName, autosizeImageProps);
            }
            else
            {
                autosizeImageProps = new AutosizeImageProps();
            }
            byte[] array = imageInstance.ImageData;
            if (array != null)
            {
                try
                {
                    MemoryStream stream = new MemoryStream(array, false);
                    gdiImage = System.Drawing.Image.FromStream(stream);
                    if (gdiImage != null)
                    {
                        ((Bitmap)gdiImage).SetResolution(pageContext.DpiX, pageContext.DpiY);
                    }
                }
                catch
                {
                    array = null;
                    if (gdiImage != null)
                    {
                        gdiImage.Dispose();
                        gdiImage = null;
                    }
                }
            }
            if (array == null)
            {
                gdiImage = (Bitmap)SPBProcessing.SPBResourceManager.GetObject("InvalidImage");
                result   = true;
                autosizeImageProps.InvalidImage = true;
            }
            if (gdiImage != null)
            {
                this.ResizeImage(pageContext, gdiImage.Width, gdiImage.Height);
                autosizeImageProps.Width  = gdiImage.Width;
                autosizeImageProps.Height = gdiImage.Height;
            }
            return(result);
        }
        public bool RegisterItem(PageItem pageItem, PageContext pageContext)
        {
            if (!this.m_itemFound && pageItem != null)
            {
                switch (this.m_eventType)
                {
                case EventType.Collect:
                {
                    ReportItemInstance instance2 = pageItem.Source.Instance;
                    if (pageContext.Labels != null)
                    {
                        pageContext.Labels.WriteDocMapLabel(instance2);
                    }
                    if (pageContext.Bookmarks != null)
                    {
                        pageContext.Bookmarks.WriteBookmark(instance2);
                    }
                    if (pageContext.PageBookmarks != null)
                    {
                        pageContext.RegisterPageBookmark(instance2);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.BookmarkNavigationEvent:
                {
                    ReportItemInstance instance = pageItem.Source.Instance;
                    if (instance.Bookmark != null && SPBProcessing.CompareWithOrdinalComparison(this.m_bookmarkId, instance.Bookmark, false) == 0)
                    {
                        this.m_itemFound = true;
                        this.m_itemInfo  = instance.UniqueName;
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.DrillthroughEvent:
                {
                    ReportItemInstance instance5       = pageItem.Source.Instance;
                    TextBoxInstance    textBoxInstance = instance5 as TextBoxInstance;
                    if (textBoxInstance != null)
                    {
                        AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = (AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)pageItem.Source;
                        if (!this.HasMatchingDrillthrough(textBox.ActionInfo))
                        {
                            foreach (ParagraphInstance paragraphInstance in textBoxInstance.ParagraphInstances)
                            {
                                foreach (TextRunInstance textRunInstance in paragraphInstance.TextRunInstances)
                                {
                                    AspNetCore.ReportingServices.OnDemandReportRendering.TextRun definition = textRunInstance.Definition;
                                    if (this.HasMatchingDrillthrough(definition.ActionInfo))
                                    {
                                        return(false);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        ImageInstance imageInstance2 = instance5 as ImageInstance;
                        if (imageInstance2 != null)
                        {
                            if (!this.HasMatchingDrillthrough(imageInstance2.ActionInfoWithDynamicImageMapAreas))
                            {
                                AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)pageItem.Source;
                                this.HasMatchingDrillthrough(image.ActionInfo);
                            }
                        }
                        else
                        {
                            IDynamicImageInstance dynamicImageInstance = instance5 as IDynamicImageInstance;
                            if (dynamicImageInstance != null)
                            {
                                ActionInfoWithDynamicImageMapCollection imageMaps = default(ActionInfoWithDynamicImageMapCollection);
                                using (dynamicImageInstance.GetImage(DynamicImageInstance.ImageType.PNG, out imageMaps))
                                {
                                }
                                this.HasMatchingDrillthrough(imageMaps);
                            }
                        }
                    }
                    if (this.m_itemFound)
                    {
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.DocumentMapNavigationEvent:
                {
                    ReportItemInstance instance3 = pageItem.Source.Instance;
                    if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, instance3.UniqueName, true) == 0)
                    {
                        this.m_itemFound = true;
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.GetDocumentMap:
                {
                    ReportItemInstance instance4 = pageItem.Source.Instance;
                    if (pageContext.Labels != null)
                    {
                        pageContext.Labels.WriteDocMapLabel(instance4);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.FindChart:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source2 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source2.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            ChartInstance chartInstance2 = source2.Instance as ChartInstance;
                            if (chartInstance2 != null)
                            {
                                this.WriteDynamicImageStream(chartInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindGaugePanel:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source3 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source3.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            GaugePanelInstance gaugePanelInstance2 = source3.Instance as GaugePanelInstance;
                            if (gaugePanelInstance2 != null)
                            {
                                this.WriteDynamicImageStream(gaugePanelInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindMap:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source5 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source5.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            MapInstance mapInstance2 = source5.Instance as MapInstance;
                            if (mapInstance2 != null)
                            {
                                this.WriteDynamicImageStream(mapInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindImage:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source4 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source4.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            ImageInstance imageInstance = source4.Instance as ImageInstance;
                            if (imageInstance != null)
                            {
                                Stream stream2   = this.m_createAndRegisterStream(this.m_streamName, string.Empty, null, imageInstance.MIMEType, false, StreamOper.CreateAndRegister);
                                byte[] imageData = imageInstance.ImageData;
                                if (stream2 != null && imageData != null && imageData.Length != 0)
                                {
                                    stream2.Write(imageData, 0, imageData.Length);
                                }
                            }
                        }
                    }
                    break;

                case EventType.ImageConsolidation:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem         source             = pageItem.Source;
                        GaugePanelInstance gaugePanelInstance = source.Instance as GaugePanelInstance;
                        Stream             stream             = null;
                        if (gaugePanelInstance != null)
                        {
                            stream = gaugePanelInstance.GetImage();
                        }
                        else
                        {
                            ChartInstance chartInstance = source.Instance as ChartInstance;
                            if (chartInstance != null)
                            {
                                stream = chartInstance.GetImage();
                            }
                            else
                            {
                                MapInstance mapInstance = source.Instance as MapInstance;
                                if (mapInstance != null)
                                {
                                    stream = mapInstance.GetImage();
                                }
                            }
                        }
                        if (stream != null)
                        {
                            ImageConsolidation imageConsolidation = pageContext.ImageConsolidation;
                            imageConsolidation.AppendImage(stream);
                            if (imageConsolidation.CurrentOffset >= imageConsolidation.IgnoreOffsetTill + 1 && imageConsolidation.ImageInfos.Count > 0)
                            {
                                this.m_itemFound = true;
                            }
                        }
                    }
                    break;

                default:
                    this.FindTextBox(pageItem as TextBox, pageContext);
                    break;
                }
                return(true);
            }
            return(false);
        }
 private void Visit(AspNetCore.ReportingServices.OnDemandReportRendering.ReportItem item)
 {
     if (item != null && item.Instance != null)
     {
         bool generateDocMap = this.m_generateDocMap;
         if (this.ProcessVisibilityAndContinue(item.Visibility, item.Instance.Visibility, null))
         {
             if (item is AspNetCore.ReportingServices.OnDemandReportRendering.Line || item is AspNetCore.ReportingServices.OnDemandReportRendering.Chart || item is AspNetCore.ReportingServices.OnDemandReportRendering.GaugePanel || item is AspNetCore.ReportingServices.OnDemandReportRendering.Map)
             {
                 this.GenerateSimpleReportItemDocumentMap(item);
             }
             else if (item is AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)
             {
                 this.GenerateSimpleReportItemDocumentMap(item);
                 this.VisitStyle(item.Style);
             }
             else if (item is AspNetCore.ReportingServices.OnDemandReportRendering.Image)
             {
                 this.GenerateSimpleReportItemDocumentMap(item);
                 AspNetCore.ReportingServices.OnDemandReportRendering.Image            image  = item as AspNetCore.ReportingServices.OnDemandReportRendering.Image;
                 AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType source = image.Source;
                 if (this.m_createSnapshot && (source == AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.External || source == AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database))
                 {
                     AspNetCore.ReportingServices.OnDemandReportRendering.ImageInstance imageInstance = image.Instance as AspNetCore.ReportingServices.OnDemandReportRendering.ImageInstance;
                     if (imageInstance != null)
                     {
                         byte[] imageDatum = imageInstance.ImageData;
                     }
                 }
             }
             else if (item is AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)
             {
                 this.VisitRectangle(item as AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle);
                 this.VisitStyle(item.Style);
             }
             else if (!(item is AspNetCore.ReportingServices.OnDemandReportRendering.CustomReportItem))
             {
                 bool flag = false;
                 if (this.m_generateDocMap)
                 {
                     string documentMapLabel = item.Instance.DocumentMapLabel;
                     if (documentMapLabel != null)
                     {
                         flag = true;
                         this.WriteDocumentMapBeginContainer(documentMapLabel, item.Instance.UniqueName);
                     }
                 }
                 if (item is AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)
                 {
                     this.VisitTablix(item as AspNetCore.ReportingServices.OnDemandReportRendering.Tablix);
                     this.VisitStyle(item.Style);
                 }
                 else if (item is AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)
                 {
                     this.VisitSubReport(item as AspNetCore.ReportingServices.OnDemandReportRendering.SubReport);
                 }
                 else
                 {
                     Global.Tracer.Assert(false);
                 }
                 if (flag)
                 {
                     this.WriteDocumentMapEndContainer();
                 }
             }
             this.m_generateDocMap = generateDocMap;
         }
     }
 }