Пример #1
0
        private void BuildTextRunCollection(PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph = m_source as Microsoft.ReportingServices.OnDemandReportRendering.Paragraph;
            RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null");
            ParagraphInstance paragraphInstance = null;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            IEnumerator <TextRunInstance> enumerator = paragraphInstance.TextRunInstances.GetEnumerator();

            while (enumerator.MoveNext())
            {
                TextRunInstance current = enumerator.Current;
                if (m_textRuns == null)
                {
                    m_textRuns = new List <TextRun>();
                }
                TextRun textRun = null;
                textRun = ((!current.IsCompiled) ? new TextRun(current.Definition, pageContext) : new TextRun(current.Definition, current as CompiledTextRunInstance, pageContext));
                m_textRuns.Add(textRun);
            }
        }
Пример #2
0
        public Paragraph(ParagraphInstance romParagraphInstance, string uniqueName, bool hideDuplicates)
        {
            this.m_source = romParagraphInstance.Definition;
            AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph source = this.m_source;
            Utility.AddInstanceStyles(romParagraphInstance.Style, ref this.m_styles);
            if (romParagraphInstance.IsCompiled)
            {
                this.m_spaceAfter    = romParagraphInstance.SpaceAfter;
                this.m_spaceBefore   = romParagraphInstance.SpaceBefore;
                this.m_leftIndent    = romParagraphInstance.LeftIndent;
                this.m_rightIndent   = romParagraphInstance.RightIndent;
                this.m_hangingIndent = romParagraphInstance.HangingIndent;
                this.m_listLevel     = romParagraphInstance.ListLevel;
                this.m_listStyle     = (RPLFormat.ListStyles)StyleEnumConverter.Translate(romParagraphInstance.ListStyle);
            }
            else
            {
                if (source.SpaceAfter != null && source.SpaceAfter.IsExpression)
                {
                    this.m_spaceAfter = this.m_source.Instance.SpaceAfter;
                }
                if (source.SpaceBefore != null && source.SpaceBefore.IsExpression)
                {
                    this.m_spaceBefore = this.m_source.Instance.SpaceBefore;
                }
                if (source.LeftIndent != null && source.LeftIndent.IsExpression)
                {
                    this.m_leftIndent = this.m_source.Instance.LeftIndent;
                }
                if (source.RightIndent != null && source.RightIndent.IsExpression)
                {
                    this.m_rightIndent = this.m_source.Instance.RightIndent;
                }
                if (source.HangingIndent != null && source.HangingIndent.IsExpression)
                {
                    this.m_hangingIndent = this.m_source.Instance.HangingIndent;
                }
                if (source.ListLevel != null && source.ListLevel.IsExpression)
                {
                    this.m_listLevel = this.m_source.Instance.ListLevel;
                }
                if (source.ListStyle != null && source.ListStyle.IsExpression)
                {
                    this.m_listStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(this.m_source.Instance.ListStyle);
                }
            }
            this.m_uniqueName = uniqueName;
            if (string.IsNullOrEmpty(uniqueName))
            {
                this.m_uniqueName = romParagraphInstance.UniqueName;
            }
            TextRunInstanceCollection textRunInstances = romParagraphInstance.TextRunInstances;

            foreach (TextRunInstance item in textRunInstances)
            {
                this.m_textRuns.Add(new TextRun(item, hideDuplicates));
            }
        }
Пример #3
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));
     }
 }
Пример #4
0
        internal override void WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph = m_source as Microsoft.ReportingServices.OnDemandReportRendering.Paragraph;
            RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null");
            ParagraphInstance paragraphInstance = null;
            bool flag = false;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
                flag = true;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            elemProps.UniqueName = paragraphInstance.UniqueName;
            RPLParagraphProps rPLParagraphProps = elemProps as RPLParagraphProps;

            if (!flag)
            {
                if (IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent))
                {
                    rPLParagraphProps.LeftIndent = new RPLReportSize(paragraphInstance.LeftIndent.ToString());
                }
                if (IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent))
                {
                    rPLParagraphProps.RightIndent = new RPLReportSize(paragraphInstance.RightIndent.ToString());
                }
                if (IsExpressionValue(paragraph.HangingIndent, paragraphInstance.HangingIndent))
                {
                    rPLParagraphProps.HangingIndent = new RPLReportSize(paragraphInstance.HangingIndent.ToString());
                }
                if (paragraph.ListStyle.IsExpression)
                {
                    rPLParagraphProps.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(paragraphInstance.ListStyle);
                }
                else
                {
                    rPLParagraphProps.ListStyle = null;
                }
                if (paragraph.ListLevel.IsExpression)
                {
                    rPLParagraphProps.ListLevel = paragraphInstance.ListLevel;
                }
                else
                {
                    rPLParagraphProps.ListLevel = null;
                }
                if (IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore))
                {
                    rPLParagraphProps.SpaceBefore = new RPLReportSize(paragraphInstance.SpaceBefore.ToString());
                }
                if (IsExpressionValue(paragraph.SpaceAfter, paragraphInstance.SpaceAfter))
                {
                    rPLParagraphProps.SpaceAfter = new RPLReportSize(paragraphInstance.SpaceAfter.ToString());
                }
            }
            else
            {
                if (paragraphInstance.LeftIndent != null)
                {
                    rPLParagraphProps.LeftIndent = new RPLReportSize(paragraphInstance.LeftIndent.ToString());
                }
                if (paragraphInstance.RightIndent != null)
                {
                    rPLParagraphProps.RightIndent = new RPLReportSize(paragraphInstance.RightIndent.ToString());
                }
                if (paragraphInstance.HangingIndent != null)
                {
                    rPLParagraphProps.HangingIndent = new RPLReportSize(paragraphInstance.HangingIndent.ToString());
                }
                rPLParagraphProps.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(paragraphInstance.ListStyle);
                rPLParagraphProps.ListLevel = paragraphInstance.ListLevel;
                if (paragraphInstance.SpaceBefore != null)
                {
                    rPLParagraphProps.SpaceBefore = new RPLReportSize(paragraphInstance.SpaceBefore.ToString());
                }
                if (paragraphInstance.SpaceAfter != null)
                {
                    rPLParagraphProps.SpaceAfter = new RPLReportSize(paragraphInstance.SpaceAfter.ToString());
                }
            }
            rPLParagraphProps.ParagraphNumber = m_paragraphNumber;
            rPLParagraphProps.NonSharedStyle  = WriteNonSharedStyle(null, null, pageContext, m_compiledSource);
        }
Пример #5
0
        internal override void WriteNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph = m_source as Microsoft.ReportingServices.OnDemandReportRendering.Paragraph;
            RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null");
            ParagraphInstance paragraphInstance = null;
            bool flag = false;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
                flag = true;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            spbifWriter.Write((byte)1);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(paragraphInstance.UniqueName);
            if (!flag)
            {
                if (IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent))
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(paragraphInstance.LeftIndent.ToString());
                }
                if (IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent))
                {
                    spbifWriter.Write((byte)10);
                    spbifWriter.Write(paragraphInstance.RightIndent.ToString());
                }
                if (IsExpressionValue(paragraph.HangingIndent, paragraphInstance.HangingIndent))
                {
                    spbifWriter.Write((byte)11);
                    spbifWriter.Write(paragraphInstance.HangingIndent.ToString());
                }
                if (paragraph.ListStyle.IsExpression)
                {
                    spbifWriter.Write((byte)7);
                    spbifWriter.Write(StyleEnumConverter.Translate(paragraphInstance.ListStyle));
                }
                if (paragraph.ListLevel.IsExpression)
                {
                    spbifWriter.Write((byte)8);
                    spbifWriter.Write(paragraphInstance.ListLevel);
                }
                if (IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore))
                {
                    spbifWriter.Write((byte)12);
                    spbifWriter.Write(paragraphInstance.SpaceBefore.ToString());
                }
                if (IsExpressionValue(paragraph.SpaceAfter, paragraphInstance.SpaceAfter))
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(paragraphInstance.SpaceAfter.ToString());
                }
            }
            else
            {
                if (paragraphInstance.LeftIndent != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(paragraphInstance.LeftIndent.ToString());
                }
                if (paragraphInstance.RightIndent != null)
                {
                    spbifWriter.Write((byte)10);
                    spbifWriter.Write(paragraphInstance.RightIndent.ToString());
                }
                if (paragraphInstance.HangingIndent != null)
                {
                    spbifWriter.Write((byte)11);
                    spbifWriter.Write(paragraphInstance.HangingIndent.ToString());
                }
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(paragraphInstance.ListStyle));
                spbifWriter.Write((byte)8);
                spbifWriter.Write(paragraphInstance.ListLevel);
                if (paragraphInstance.SpaceBefore != null)
                {
                    spbifWriter.Write((byte)12);
                    spbifWriter.Write(paragraphInstance.SpaceBefore.ToString());
                }
                if (paragraphInstance.SpaceAfter != null)
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(paragraphInstance.SpaceAfter.ToString());
                }
            }
            if (m_paragraphNumber > 0)
            {
                spbifWriter.Write((byte)14);
                spbifWriter.Write(m_paragraphNumber);
            }
            WriteNonSharedStyle(spbifWriter, null, null, pageContext, 6, m_compiledSource);
            spbifWriter.Write(byte.MaxValue);
        }