示例#1
0
 internal Paragraph(ParagraphInstance romParagraphInstance, string uniqueName, bool hideDuplicates)
 {
     m_source = romParagraphInstance.Definition;
     Microsoft.ReportingServices.OnDemandReportRendering.Paragraph source = m_source;
     Utility.AddInstanceStyles(romParagraphInstance.Style, ref m_styles);
     if (romParagraphInstance.IsCompiled)
     {
         m_spaceAfter    = romParagraphInstance.SpaceAfter;
         m_spaceBefore   = romParagraphInstance.SpaceBefore;
         m_leftIndent    = romParagraphInstance.LeftIndent;
         m_rightIndent   = romParagraphInstance.RightIndent;
         m_hangingIndent = romParagraphInstance.HangingIndent;
         m_listLevel     = romParagraphInstance.ListLevel;
         m_listStyle     = (RPLFormat.ListStyles)StyleEnumConverter.Translate(romParagraphInstance.ListStyle);
     }
     else
     {
         if (source.SpaceAfter != null && source.SpaceAfter.IsExpression)
         {
             m_spaceAfter = m_source.Instance.SpaceAfter;
         }
         if (source.SpaceBefore != null && source.SpaceBefore.IsExpression)
         {
             m_spaceBefore = m_source.Instance.SpaceBefore;
         }
         if (source.LeftIndent != null && source.LeftIndent.IsExpression)
         {
             m_leftIndent = m_source.Instance.LeftIndent;
         }
         if (source.RightIndent != null && source.RightIndent.IsExpression)
         {
             m_rightIndent = m_source.Instance.RightIndent;
         }
         if (source.HangingIndent != null && source.HangingIndent.IsExpression)
         {
             m_hangingIndent = m_source.Instance.HangingIndent;
         }
         if (source.ListLevel != null && source.ListLevel.IsExpression)
         {
             m_listLevel = m_source.Instance.ListLevel;
         }
         if (source.ListStyle != null && source.ListStyle.IsExpression)
         {
             m_listStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(m_source.Instance.ListStyle);
         }
     }
     m_uniqueName = uniqueName;
     if (string.IsNullOrEmpty(uniqueName))
     {
         m_uniqueName = romParagraphInstance.UniqueName;
     }
     foreach (TextRunInstance textRunInstance in romParagraphInstance.TextRunInstances)
     {
         m_textRuns.Add(new TextRun(textRunInstance, hideDuplicates));
     }
 }
示例#2
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);
            }
        }
示例#3
0
        internal void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            Hashtable         itemPropsStart    = pageContext.ItemPropsStart;
            long primitiveFromCache             = pageContext.Common.GetPrimitiveFromCache <long>(m_source.ID, out itemPropsStart);

            if (primitiveFromCache <= 0)
            {
                primitiveFromCache          = spbifWriter.BaseStream.Position;
                itemPropsStart[m_source.ID] = primitiveFromCache;
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)0);
                spbifWriter.Write((byte)6);
                spbifWriter.Write((byte)0);
                WriteSharedStyles(styleWriterStream, m_source.Style);
                spbifWriter.Write(byte.MaxValue);
                styleWriterStream.WriteSharedProperty(8, m_source.ListLevel);
                if (m_source.ListStyle != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(m_source.ListStyle.Value));
                }
                styleWriterStream.WriteSharedProperty(9, m_source.LeftIndent);
                styleWriterStream.WriteSharedProperty(10, m_source.RightIndent);
                styleWriterStream.WriteSharedProperty(11, m_source.HangingIndent);
                styleWriterStream.WriteSharedProperty(12, m_source.SpaceBefore);
                styleWriterStream.WriteSharedProperty(13, m_source.SpaceAfter);
                styleWriterStream.WriteNotNull(5, m_source.ID);
                spbifWriter.Write(byte.MaxValue);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
            }
            spbifWriter.Write((byte)1);
            Utility.WriteReportSize(spbifWriter, 9, m_leftIndent);
            Utility.WriteReportSize(spbifWriter, 10, m_rightIndent);
            Utility.WriteReportSize(spbifWriter, 11, m_hangingIndent);
            if (m_listStyle.HasValue)
            {
                styleWriterStream.Write(7, (byte)m_listStyle.Value);
            }
            if (m_listLevel.HasValue)
            {
                styleWriterStream.Write(8, m_listLevel.Value);
            }
            if (!m_firstLine)
            {
                styleWriterStream.Write(15, m_firstLine);
            }
            Utility.WriteReportSize(spbifWriter, 12, m_spaceBefore);
            Utility.WriteReportSize(spbifWriter, 13, m_spaceAfter);
            styleWriterStream.Write(14, m_paragraphNumber);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            WriteNonSharedStyles(styleWriterStream);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(m_uniqueName);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write(byte.MaxValue);
        }
示例#4
0
        internal void WriteElementProps(RPLParagraphProps elemProps, PageContext pageContext)
        {
            Hashtable            itemPropsStart       = pageContext.ItemPropsStart;
            RPLParagraphPropsDef rPLParagraphPropsDef = pageContext.Common.GetFromCache <RPLParagraphPropsDef>(m_source.ID, out itemPropsStart);

            if (rPLParagraphPropsDef == null)
            {
                rPLParagraphPropsDef             = new RPLParagraphPropsDef();
                rPLParagraphPropsDef.SharedStyle = new RPLStyleProps();
                WriteSharedStyles(new StyleWriterOM(rPLParagraphPropsDef.SharedStyle), m_source.Style);
                if (m_source.ListLevel != null && !m_source.ListLevel.IsExpression)
                {
                    rPLParagraphPropsDef.ListLevel = m_source.ListLevel.Value;
                }
                if (m_source.ListStyle != null && !m_source.ListStyle.IsExpression)
                {
                    rPLParagraphPropsDef.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(m_source.ListStyle.Value);
                }
                if (m_source.LeftIndent != null && !m_source.LeftIndent.IsExpression)
                {
                    rPLParagraphPropsDef.LeftIndent = new RPLReportSize(m_source.LeftIndent.Value.ToString());
                }
                if (m_source.RightIndent != null && !m_source.RightIndent.IsExpression)
                {
                    rPLParagraphPropsDef.RightIndent = new RPLReportSize(m_source.RightIndent.Value.ToString());
                }
                if (m_source.HangingIndent != null && !m_source.HangingIndent.IsExpression)
                {
                    rPLParagraphPropsDef.HangingIndent = new RPLReportSize(m_source.HangingIndent.Value.ToString());
                }
                if (m_source.SpaceBefore != null && !m_source.SpaceBefore.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(m_source.SpaceBefore.Value.ToString());
                }
                if (m_source.SpaceAfter != null && !m_source.SpaceAfter.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(m_source.SpaceAfter.Value.ToString());
                }
                rPLParagraphPropsDef.ID     = m_source.ID;
                itemPropsStart[m_source.ID] = rPLParagraphPropsDef;
            }
            elemProps.Definition = rPLParagraphPropsDef;
            if (m_leftIndent != null)
            {
                elemProps.LeftIndent = new RPLReportSize(m_leftIndent.ToString());
            }
            if (m_rightIndent != null)
            {
                elemProps.RightIndent = new RPLReportSize(m_rightIndent.ToString());
            }
            if (m_hangingIndent != null)
            {
                elemProps.HangingIndent = new RPLReportSize(m_hangingIndent.ToString());
            }
            if (m_listStyle.HasValue)
            {
                elemProps.ListStyle = m_listStyle.Value;
            }
            if (m_listLevel.HasValue)
            {
                elemProps.ListLevel = m_listLevel.Value;
            }
            if (m_spaceBefore != null)
            {
                elemProps.SpaceBefore = new RPLReportSize(m_spaceBefore.ToString());
            }
            if (m_spaceAfter != null)
            {
                elemProps.SpaceAfter = new RPLReportSize(m_spaceAfter.ToString());
            }
            elemProps.ParagraphNumber = m_paragraphNumber;
            elemProps.FirstLine       = m_firstLine;
            elemProps.UniqueName      = m_uniqueName;
            RPLStyleProps rPLStyleProps = null;

            if (m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                ((StyleWriter) new StyleWriterOM(rPLStyleProps)).WriteAll(m_styles);
            }
            elemProps.NonSharedStyle = rPLStyleProps;
        }
示例#5
0
        private void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <Microsoft.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            string            text = m_source.ID;
            bool flag = true;
            ReportStringProperty value = m_source.Value;

            if ((m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            TextRunItemizedData glyphData = null;
            string    value2             = null;
            Hashtable itemPropsStart     = pageContext.ItemPropsStart;
            long      primitiveFromCache = pageContext.Common.GetPrimitiveFromCache <long>(text, out itemPropsStart);

            if (primitiveFromCache <= 0)
            {
                primitiveFromCache   = spbifWriter.BaseStream.Position;
                itemPropsStart[text] = primitiveFromCache;
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)0);
                spbifWriter.Write((byte)6);
                spbifWriter.Write((byte)0);
                WriteSharedStyles(styleWriterStream, m_source.Style);
                spbifWriter.Write(byte.MaxValue);
                styleWriterStream.WriteNotNull(5, text);
                styleWriterStream.WriteNotNull(8, m_source.Label);
                if (m_source.MarkupType != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(m_source.MarkupType.Value));
                }
                styleWriterStream.WriteSharedProperty(9, m_source.ToolTip);
                if (flag && !hideDuplicates && value != null && !m_source.FormattedValueExpressionBased)
                {
                    if (m_source.SharedTypeCode == TypeCode.String)
                    {
                        styleWriterStream.WriteNotNull(10, GetStringValue(value.Value, null, null, previousRunCount, richTextRuns, out glyphData));
                    }
                    else
                    {
                        styleWriterStream.WriteNotNull(10, GetStringValue(m_source.Instance.Value, null, null, previousRunCount, richTextRuns, out glyphData));
                    }
                }
                spbifWriter.Write(byte.MaxValue);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
                if (richTextRuns != null && flag && !hideDuplicates && value != null && !m_source.FormattedValueExpressionBased)
                {
                    glyphData = GetGlyphValue(value.Value, previousRunCount, richTextRuns);
                }
            }
            spbifWriter.Write((byte)1);
            TextRunItemizedData glyphData2 = null;

            if (!flag)
            {
                if (!hideDuplicates && value != null)
                {
                    value2 = ((m_source.SharedTypeCode != TypeCode.String) ? GetStringValue(m_source.Instance.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2) : GetStringValue(value.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2));
                }
            }
            else
            {
                value2 = GetStringValue(m_text, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2);
            }
            if (glyphData2 == null)
            {
                glyphData2 = glyphData;
            }
            pageContext.RegisterTextRunData(glyphData2);
            styleWriterStream.WriteNotNull(10, value2);
            styleWriterStream.WriteNotNull(9, m_toolTip);
            styleWriterStream.WriteNotNull(4, m_uniqueName);
            styleWriterStream.WriteNotNull(7, m_markup);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            if (m_styles != null)
            {
                styleWriterStream.WriteAll(m_styles);
            }
            spbifWriter.Write(byte.MaxValue);
            WriteActions(spbifWriter);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write(byte.MaxValue);
        }
示例#6
0
        private void WriteElementProps(RPLTextRunProps props, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <Microsoft.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            Hashtable            itemPropsStart = pageContext.ItemPropsStart;
            string               text           = m_source.ID;
            bool                 flag           = true;
            ReportStringProperty value          = m_source.Value;

            if ((m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            RPLTextRunPropsDef  rPLTextRunPropsDef = pageContext.Common.GetFromCache <RPLTextRunPropsDef>(text, out itemPropsStart);
            TextRunItemizedData glyphData          = null;

            if (rPLTextRunPropsDef == null)
            {
                rPLTextRunPropsDef             = new RPLTextRunPropsDef();
                rPLTextRunPropsDef.SharedStyle = new RPLStyleProps();
                WriteSharedStyles(new StyleWriterOM(rPLTextRunPropsDef.SharedStyle), m_source.Style);
                if (m_source.Label != null)
                {
                    rPLTextRunPropsDef.Label = m_source.Label;
                }
                if (m_source.MarkupType != null && !m_source.MarkupType.IsExpression)
                {
                    rPLTextRunPropsDef.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(m_source.MarkupType.Value);
                }
                if (m_source.ToolTip != null && !m_source.ToolTip.IsExpression)
                {
                    rPLTextRunPropsDef.ToolTip = m_source.ToolTip.Value;
                }
                if (flag && value != null && !m_source.FormattedValueExpressionBased && !hideDuplicates)
                {
                    if (m_source.SharedTypeCode == TypeCode.String)
                    {
                        rPLTextRunPropsDef.Value = GetStringValue(value.Value, null, null, previousRunCount, richTextRuns, out glyphData);
                    }
                    else
                    {
                        rPLTextRunPropsDef.Value = GetStringValue(m_source.Instance.Value, null, null, previousRunCount, richTextRuns, out glyphData);
                    }
                }
                rPLTextRunPropsDef.ID = text;
                itemPropsStart[text]  = rPLTextRunPropsDef;
            }
            else if (richTextRuns != null && flag && !hideDuplicates && value != null && !m_source.FormattedValueExpressionBased)
            {
                glyphData = GetGlyphValue(value.Value, previousRunCount, richTextRuns);
            }
            props.Definition = rPLTextRunPropsDef;
            props.UniqueName = m_uniqueName;
            if (m_markup.HasValue)
            {
                props.Markup = (RPLFormat.MarkupStyles)m_markup.Value;
            }
            props.ToolTip = m_toolTip;
            TextRunItemizedData glyphData2 = null;

            if (!flag)
            {
                if (value != null && !hideDuplicates)
                {
                    if (m_source.SharedTypeCode == TypeCode.String)
                    {
                        props.Value = GetStringValue(value.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2);
                    }
                    else
                    {
                        props.Value = GetStringValue(m_source.Instance.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2);
                    }
                }
            }
            else
            {
                props.Value = GetStringValue(m_text, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2);
            }
            if (glyphData2 == null)
            {
                glyphData2 = glyphData;
            }
            pageContext.RegisterTextRunData(glyphData2);
            if (m_hyperlinks != null)
            {
                int count = m_hyperlinks.Count;
                props.ActionInfo = new RPLActionInfo(count);
                for (int i = 0; i < count; i++)
                {
                    string    text2     = m_hyperlinks[i];
                    RPLAction rPLAction = new RPLAction();
                    if (text2 != null)
                    {
                        rPLAction.Hyperlink = text2;
                    }
                    props.ActionInfo.Actions[i] = rPLAction;
                }
            }
            RPLStyleProps rPLStyleProps = null;

            if (m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                new StyleWriterOM(rPLStyleProps).WriteAll(m_styles);
            }
            props.NonSharedStyle = rPLStyleProps;
        }