コード例 #1
0
 public static void AddStyle(byte rplId, ReportStringProperty prop, StyleWriter writer)
 {
     if (prop != null && prop.Value != null)
     {
         writer.Write(rplId, prop.Value);
     }
 }
コード例 #2
0
 public void WriteSharedProperty(byte rplId, ReportStringProperty prop)
 {
     if (prop != null && !prop.IsExpression && prop.Value != null)
     {
         this.Write(rplId, prop.Value);
     }
 }
コード例 #3
0
        internal void WriteStartItemToStream(RPLWriter rplWriter)
        {
            if (rplWriter == null)
            {
                return;
            }
            BinaryWriter         binaryWriter = rplWriter.BinaryWriter;
            string               language     = null;
            ReportStringProperty language2    = m_report.Language;

            if (language2 != null)
            {
                language = ((!language2.IsExpression) ? language2.Value : m_report.Instance.Language);
            }
            if (binaryWriter != null)
            {
                if (m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                {
                    WriteStartItemToRPLStream2008(binaryWriter, language);
                }
                else
                {
                    WriteStartItemToRPLStream(binaryWriter, language);
                }
            }
            else
            {
                WriteStartItemToRPLOM(rplWriter, language);
            }
        }
コード例 #4
0
        internal static string GetReportLanguage(Microsoft.ReportingServices.OnDemandReportRendering.Report report)
        {
            string result = null;
            ReportStringProperty language = report.Language;

            if (language != null)
            {
                result = ((!language.IsExpression) ? language.Value : report.Instance.Language);
            }
            return(result);
        }
コード例 #5
0
        public static string GetReportLanguage(AspNetCore.ReportingServices.OnDemandReportRendering.Report report)
        {
            string result = null;
            ReportStringProperty language = report.Language;

            if (language != null)
            {
                if (language.IsExpression)
                {
                    ReportInstance instance = report.Instance;
                    result = instance.Language;
                }
                else
                {
                    result = language.Value;
                }
            }
            return(result);
        }
コード例 #6
0
        public static string GetStringProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object obj = null;

            if (styles != null && styles.TryGetValue(rplId, out obj))
            {
                string text = obj as string;
                if (text != null)
                {
                    return(text);
                }
            }
            ReportStringProperty reportStringProperty = ((StyleBase)styleDef)[styleAttributeName] as ReportStringProperty;

            if (reportStringProperty != null && !reportStringProperty.IsExpression)
            {
                return(reportStringProperty.Value);
            }
            return(null);
        }
コード例 #7
0
        internal static string GetStringProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object value = null;

            if (styles != null && styles.TryGetValue(rplId, out value))
            {
                string text = value as string;
                if (text != null)
                {
                    return(text);
                }
            }
            ReportStringProperty reportStringProperty = styleDef[styleAttributeName] as ReportStringProperty;

            if (reportStringProperty != null && !reportStringProperty.IsExpression)
            {
                return(reportStringProperty.Value);
            }
            return(null);
        }
コード例 #8
0
 public void WriteStartItemToStream(RPLWriter rplWriter)
 {
     if (rplWriter != null)
     {
         BinaryWriter         binaryWriter = rplWriter.BinaryWriter;
         string               language     = null;
         ReportStringProperty language2    = this.m_report.Language;
         if (language2 != null)
         {
             if (language2.IsExpression)
             {
                 ReportInstance instance = this.m_report.Instance;
                 language = instance.Language;
             }
             else
             {
                 language = language2.Value;
             }
         }
         if (binaryWriter != null)
         {
             if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
             {
                 this.WriteStartItemToRPLStream2008(binaryWriter, language);
             }
             else
             {
                 this.WriteStartItemToRPLStream(binaryWriter, language);
             }
         }
         else
         {
             this.WriteStartItemToRPLOM(rplWriter, language);
         }
     }
 }
コード例 #9
0
        private void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            string            text = this.m_source.ID;
            bool flag = true;
            ReportStringProperty value = this.m_source.Value;

            if ((this.m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !this.m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            TextRunItemizedData textRunItemizedData = 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);
                this.WriteSharedStyles(styleWriterStream, this.m_source.Style);
                spbifWriter.Write((byte)255);
                styleWriterStream.WriteNotNull(5, text);
                styleWriterStream.WriteNotNull(8, this.m_source.Label);
                if (this.m_source.MarkupType != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(this.m_source.MarkupType.Value));
                }
                styleWriterStream.WriteSharedProperty(9, this.m_source.ToolTip);
                if (flag && !hideDuplicates && value != null && !this.m_source.FormattedValueExpressionBased)
                {
                    if (this.m_source.SharedTypeCode == TypeCode.String)
                    {
                        styleWriterStream.WriteNotNull(10, this.GetStringValue(value.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData));
                    }
                    else
                    {
                        styleWriterStream.WriteNotNull(10, this.GetStringValue(this.m_source.Instance.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData));
                    }
                }
                spbifWriter.Write((byte)255);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
                if (richTextRuns != null && flag && !hideDuplicates && value != null && !this.m_source.FormattedValueExpressionBased)
                {
                    textRunItemizedData = this.GetGlyphValue(value.Value, previousRunCount, richTextRuns);
                }
            }
            spbifWriter.Write((byte)1);
            TextRunItemizedData textRunItemizedData2 = null;

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

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

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

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

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