예제 #1
0
        internal override void WriteSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext, long offset)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            Hashtable hashtable = pageContext.ItemPropsStart;

            if (hashtable != null)
            {
                object obj = hashtable[SourceID];
                if (obj != null)
                {
                    spbifWriter.Write((byte)2);
                    spbifWriter.Write((long)obj);
                    return;
                }
            }
            if (hashtable == null)
            {
                hashtable = (pageContext.ItemPropsStart = new Hashtable());
            }
            hashtable.Add(SourceID, offset);
            spbifWriter.Write((byte)0);
            spbifWriter.Write((byte)5);
            spbifWriter.Write(SourceID);
            if (!textRun.MarkupType.IsExpression)
            {
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(textRun.MarkupType.Value));
            }
            if (textRun.Label != null)
            {
                spbifWriter.Write((byte)8);
                spbifWriter.Write(textRun.Label);
            }
            if (textRun.ToolTip != null && !textRun.ToolTip.IsExpression && textRun.ToolTip.Value != null)
            {
                spbifWriter.Write((byte)9);
                spbifWriter.Write(textRun.ToolTip.Value);
            }
            if (textRun.Value.IsExpression)
            {
                spbifWriter.Write((byte)12);
                spbifWriter.Write(textRun.Value.ExpressionString);
            }
            if (!pageContext.HideDuplicates && !textRun.FormattedValueExpressionBased && textRun.Value.Value != null)
            {
                spbifWriter.Write((byte)10);
                if (textRun.SharedTypeCode == TypeCode.String)
                {
                    spbifWriter.Write(textRun.Value.Value);
                }
                else
                {
                    spbifWriter.Write(textRun.Instance.Value);
                }
            }
            WriteSharedStyle(spbifWriter, null, pageContext, 6);
            spbifWriter.Write(byte.MaxValue);
        }
예제 #2
0
        public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.Text:
                    m_text = reader.ReadString();
                    break;

                case MemberName.Style:
                    m_styles = reader.ReadByteVariantHashtable <Dictionary <byte, object> >();
                    break;

                case MemberName.ToolTip:
                    m_toolTip = reader.ReadString();
                    break;

                case MemberName.MarkupType:
                    m_markup = (reader.ReadVariant() as byte?);
                    break;

                case MemberName.Actions:
                    m_hyperlinks = reader.ReadListOfPrimitives <string>();
                    break;

                case MemberName.UniqueName:
                    m_uniqueName = reader.ReadString();
                    break;

                case MemberName.Source:
                    m_source = (Microsoft.ReportingServices.OnDemandReportRendering.TextRun)scalabilityCache.FetchStaticReference(reader.ReadInt32());
                    break;

                case MemberName.Indexes:
                    m_splitIndices = reader.ReadListOfPrimitives <int>();
                    break;

                case MemberName.Offset:
                    m_startCharacterOffset = reader.ReadInt32();
                    break;

                case MemberName.Key:
                    m_fontKey = reader.ReadString();
                    break;

                default:
                    RSTrace.RenderingTracer.Assert(condition: false, string.Empty);
                    break;
                }
            }
        }
예제 #3
0
        internal override void WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;
            bool            flag            = false;

            if (m_compiledSource != null)
            {
                textRunInstance = m_compiledSource;
                flag            = true;
            }
            else
            {
                textRunInstance = textRun.Instance;
                RSTrace.RenderingTracer.Assert(textRunInstance != null, "The text run instance cannot be null");
            }
            elemProps.UniqueName = textRunInstance.UniqueName;
            RPLTextRunProps rPLTextRunProps = elemProps as RPLTextRunProps;

            if (!flag)
            {
                rPLTextRunProps.ProcessedWithError = textRunInstance.ProcessedWithError;
                if (textRun.MarkupType.IsExpression)
                {
                    rPLTextRunProps.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(textRunInstance.MarkupType);
                }
                if (textRun.ToolTip != null && textRun.ToolTip.IsExpression && textRunInstance.ToolTip != null)
                {
                    rPLTextRunProps.ToolTip = textRunInstance.ToolTip;
                }
                rPLTextRunProps.ActionInfo = WriteActionInfo(textRun.ActionInfo, pageContext);
            }
            else
            {
                rPLTextRunProps.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(textRunInstance.MarkupType);
                if (textRunInstance.ToolTip != null)
                {
                    rPLTextRunProps.ToolTip = textRunInstance.ToolTip;
                }
                if (m_compiledSource.ActionInstance != null)
                {
                    rPLTextRunProps.ActionInfo = WriteActionInstance(m_compiledSource.ActionInstance, pageContext);
                }
            }
            if ((pageContext.HideDuplicates || textRun.FormattedValueExpressionBased) && textRunInstance.Value != null)
            {
                rPLTextRunProps.Value = textRunInstance.Value;
            }
            pageContext.HideDuplicates     = false;
            pageContext.TypeCodeNonString  = false;
            rPLTextRunProps.NonSharedStyle = WriteNonSharedStyle(null, null, pageContext, m_compiledSource);
        }
예제 #4
0
        internal override void WriteSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            Hashtable hashtable = pageContext.ItemPropsStart;

            if (hashtable != null)
            {
                object obj = hashtable[SourceID];
                if (obj != null)
                {
                    elemProps.Definition = (RPLTextRunPropsDef)obj;
                    return;
                }
            }
            RPLTextRunPropsDef rPLTextRunPropsDef = (elemProps as RPLTextRunProps).Definition as RPLTextRunPropsDef;

            if (hashtable == null)
            {
                hashtable = (pageContext.ItemPropsStart = new Hashtable());
            }
            hashtable.Add(SourceID, rPLTextRunPropsDef);
            rPLTextRunPropsDef.ID = SourceID;
            if (!textRun.MarkupType.IsExpression)
            {
                rPLTextRunPropsDef.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(textRun.MarkupType.Value);
            }
            if (textRun.Label != null)
            {
                rPLTextRunPropsDef.Label = textRun.Label;
            }
            if (textRun.ToolTip != null && !textRun.ToolTip.IsExpression && textRun.ToolTip.Value != null)
            {
                rPLTextRunPropsDef.ToolTip = textRun.ToolTip.Value;
            }
            if (textRun.Value.IsExpression)
            {
                rPLTextRunPropsDef.Formula = textRun.Value.ExpressionString;
            }
            if (!pageContext.HideDuplicates && !textRun.FormattedValueExpressionBased && textRun.Value.Value != null)
            {
                if (textRun.SharedTypeCode == TypeCode.String)
                {
                    rPLTextRunPropsDef.Value = textRun.Value.Value;
                }
                else
                {
                    rPLTextRunPropsDef.Value = textRun.Instance.Value;
                }
            }
            rPLTextRunPropsDef.SharedStyle = WriteSharedStyle(null, pageContext);
        }
예제 #5
0
        internal TextRun(TextRunInstance instance, bool hideDuplicates)
        {
            m_source = instance.Definition;
            Utility.AddInstanceStyles(instance.Style, ref m_styles);
            if (instance.IsCompiled)
            {
                m_text    = instance.Value;
                m_toolTip = instance.ToolTip;
            }
            else
            {
                m_text    = ((m_source.Value != null && (m_source.FormattedValueExpressionBased || hideDuplicates)) ? instance.Value : null);
                m_toolTip = ((m_source.ToolTip != null && m_source.ToolTip.IsExpression) ? instance.ToolTip : null);
            }
            ActionInfo actionInfo = m_source.ActionInfo;

            if (instance.IsCompiled)
            {
                ActionInstance actionInstance = (instance as CompiledTextRunInstance).ActionInstance;
                if (actionInstance != null)
                {
                    m_hyperlinks = new List <string>(1);
                    ReportUrl hyperlink = actionInstance.Hyperlink;
                    string    item      = null;
                    if (hyperlink != null)
                    {
                        item = hyperlink.ToString();
                    }
                    m_hyperlinks.Add(item);
                }
            }
            else if (actionInfo != null)
            {
                ActionCollection actions = actionInfo.Actions;
                m_hyperlinks = new List <string>(actions.Count);
                foreach (Microsoft.ReportingServices.OnDemandReportRendering.Action item3 in actions)
                {
                    ReportUrl hyperlink2 = item3.Instance.Hyperlink;
                    string    item2      = null;
                    if (hyperlink2 != null)
                    {
                        item2 = hyperlink2.ToString();
                    }
                    m_hyperlinks.Add(item2);
                }
            }
            m_uniqueName = instance.UniqueName;
            if (m_source.MarkupType != null && m_source.MarkupType.IsExpression)
            {
                m_markup = StyleEnumConverter.Translate(instance.MarkupType);
            }
        }
예제 #6
0
 internal string ComputeValue()
 {
     if (m_compiledSource == null)
     {
         Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
         if (textRun.FormattedValueExpressionBased)
         {
             return(textRun.Instance.Value);
         }
         return(textRun.Value.Value);
     }
     return(m_compiledSource.Value);
 }
예제 #7
0
        internal Microsoft.ReportingServices.Rendering.RichText.TextRun GetRichTextRun()
        {
            string text = null;

            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;

            textRunInstance = ((m_compiledSource != null) ? m_compiledSource : textRun.Instance);
            text            = textRunInstance.Value;
            if (string.IsNullOrEmpty(text) && textRun.Value != null)
            {
                text = textRun.Value.Value;
            }
            return(new Microsoft.ReportingServices.Rendering.RichText.TextRun(text, this));
        }
예제 #8
0
        public bool MoveNext()
        {
            TextRunCollection textRuns = m_paragraphInstance.Definition.TextRuns;

            if (m_currentIndex < textRuns.Count)
            {
                TextRun textRun = textRuns[m_currentIndex];
                if (textRun.Instance.MarkupType != 0)
                {
                    if (m_textRunInstances == null)
                    {
                        if (textRuns.Count > 1)
                        {
                            m_textRunInstances = textRun.CompiledInstance.CompiledParagraphInstances[0].CompiledTextRunInstances;
                        }
                        else
                        {
                            m_textRunInstances = ((CompiledParagraphInstance)m_paragraphInstance).CompiledTextRunInstances;
                        }
                    }
                    if (m_currentCompiledIndex >= m_textRunInstances.Count)
                    {
                        m_textRunInstances     = null;
                        m_currentCompiledIndex = 0;
                        m_currentIndex++;
                        return(MoveNext());
                    }
                    m_textRunInstance = m_textRunInstances[m_currentCompiledIndex];
                    m_currentCompiledIndex++;
                }
                else
                {
                    m_textRunInstance = textRun.Instance;
                    m_currentIndex++;
                }
                return(true);
            }
            return(false);
        }
예제 #9
0
        internal bool RegisterItem(PageItem pageItem, PageContext pageContext)
        {
            if (m_itemFound || pageItem == null)
            {
                return(false);
            }
            switch (m_eventType)
            {
            case EventType.Collect:
            {
                ReportItemInstance instance5 = pageItem.Source.Instance;
                if (pageContext.Labels != null)
                {
                    pageContext.Labels.WriteDocMapLabel(instance5);
                }
                if (pageContext.Bookmarks != null)
                {
                    pageContext.Bookmarks.WriteBookmark(instance5);
                }
                if (pageContext.PageBookmarks != null)
                {
                    pageContext.RegisterPageBookmark(instance5);
                }
                if (pageItem.ItemState != PageItem.State.OnPageHidden)
                {
                    return(false);
                }
                break;
            }

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

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

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

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

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

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

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

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

            case EventType.ImageConsolidation:
            {
                if (pageItem.ItemState == PageItem.State.OnPageHidden)
                {
                    break;
                }
                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)
                    {
                        m_itemFound = true;
                    }
                }
                break;
            }

            default:
                FindTextBox(pageItem as TextBox, pageContext);
                break;
            }
            return(true);
        }
 internal ShimTextRunInstance(TextRun textRunDef, TextBoxInstance textBoxInstance)
     : base(textRunDef)
 {
     m_textBoxInstance = textBoxInstance;
 }
예제 #11
0
        internal override void WriteNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;
            bool            flag            = false;

            if (m_compiledSource != null)
            {
                textRunInstance = m_compiledSource;
                flag            = true;
            }
            else
            {
                textRunInstance = textRun.Instance;
                RSTrace.RenderingTracer.Assert(textRunInstance != null, "The text run instance cannot be null");
            }
            spbifWriter.Write((byte)1);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(textRunInstance.UniqueName);
            if (!flag)
            {
                if (textRunInstance.ProcessedWithError)
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(value: true);
                }
                if (textRun.MarkupType.IsExpression)
                {
                    spbifWriter.Write((byte)7);
                    spbifWriter.Write(StyleEnumConverter.Translate(textRunInstance.MarkupType));
                }
                if (textRun.ToolTip != null && textRun.ToolTip.IsExpression && textRunInstance.ToolTip != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(textRunInstance.ToolTip);
                }
                WriteActionInfo(textRun.ActionInfo, spbifWriter, pageContext, 11);
            }
            else
            {
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(textRunInstance.MarkupType));
                if (textRunInstance.ToolTip != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(textRunInstance.ToolTip);
                }
                if (m_compiledSource.ActionInstance != null)
                {
                    WriteActionInstance(m_compiledSource.ActionInstance, spbifWriter, pageContext);
                }
            }
            if ((pageContext.HideDuplicates || textRun.FormattedValueExpressionBased) && textRunInstance.Value != null)
            {
                spbifWriter.Write((byte)10);
                spbifWriter.Write(textRunInstance.Value);
            }
            pageContext.HideDuplicates    = false;
            pageContext.TypeCodeNonString = false;
            WriteNonSharedStyle(spbifWriter, null, null, pageContext, 6, m_compiledSource);
            spbifWriter.Write(byte.MaxValue);
        }
예제 #12
0
 internal TextRun(Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun, CompiledTextRunInstance compiledTextRun, PageContext pageContext)
     : base(textRun)
 {
     m_compiledSource = compiledTextRun;
 }
예제 #13
0
 internal TextRun(Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun, PageContext pageContext)
     : this(textRun, null, pageContext)
 {
 }
 internal TextRunInstance(TextRun textRunDef)
     : base(textRunDef)
 {
 }