Exemple #1
0
        private double GetPaddings(StyleAttributeNames padd1, StyleAttributeNames padd2)
        {
            double     num        = 0.0;
            ReportSize styleValue = GetStyleValue(padd1);

            if (styleValue != null)
            {
                num += styleValue.ToMillimeters();
            }
            styleValue = GetStyleValue(padd2);
            if (styleValue != null)
            {
                num += styleValue.ToMillimeters();
            }
            return(num);
        }
Exemple #2
0
        private void ApplyPendingMargins()
        {
            ICompiledParagraphInstance lastPopulatedParagraph = m_flatStore.LastPopulatedParagraph;
            ReportSize pendingMarginBottom = m_flatStore.PendingMarginBottom;

            if (IsNonEmptySize(pendingMarginBottom))
            {
                if (lastPopulatedParagraph != null)
                {
                    ReportSize marginTop = m_flatStore.MarginTop;
                    if (marginTop == null)
                    {
                        AddToParagraphSpaceAfter(lastPopulatedParagraph, pendingMarginBottom);
                    }
                    else if (pendingMarginBottom.ToMillimeters() >= marginTop.ToMillimeters())
                    {
                        AddToParagraphSpaceAfter(lastPopulatedParagraph, pendingMarginBottom);
                        m_flatStore.ClearMarginTop();
                    }
                }
                else
                {
                    m_flatStore.UpdateMarginTop(pendingMarginBottom);
                }
                m_flatStore.ClearPendingMarginBottom();
            }
            m_flatStore.LastPopulatedParagraph = null;
        }
Exemple #3
0
 private bool IsNonEmptySize(ReportSize size)
 {
     if (size != null)
     {
         return(size.ToMillimeters() > 0.0);
     }
     return(false);
 }
Exemple #4
0
        internal void AddSpaceBefore(ReportSize size)
        {
            ReportSize spaceBefore = m_flatStore.SpaceBefore;
            ReportSize reportSize  = ReportSize.SumSizes(spaceBefore, size);

            m_hasSpaceBefore        = (reportSize != null && reportSize.ToMillimeters() > 0.0 && (spaceBefore == null || reportSize.ToMillimeters() != spaceBefore.ToMillimeters()));
            m_flatStore.SpaceBefore = reportSize;
        }
 internal ReportBody(Body source, ReportSize width)
     : base(null)
 {
     m_itemPageSizes             = new ItemSizes(0.0, 0.0, width.ToMillimeters(), source.Height.ToMillimeters());
     m_originalWidth             = m_itemPageSizes.Width;
     m_source                    = source;
     base.KeepTogetherHorizontal = false;
     base.KeepTogetherVertical   = false;
     base.UnresolvedKTV          = (base.UnresolvedKTH = false);
 }
Exemple #6
0
        private double ParseSize(string sizeValue, double defaultValue)
        {
            double     result     = defaultValue;
            ReportSize reportSize = default(ReportSize);

            if (sizeValue != null && sizeValue.Length > 0 && ReportSize.TryParse(sizeValue, out reportSize))
            {
                result = reportSize.ToMillimeters();
            }
            return(result);
        }
        public void GetPaddingValues(ReportItem source, out double padVertical, out double padHorizontal, out double padTop)
        {
            padVertical   = this.m_padVertical;
            padHorizontal = this.m_padHorizontal;
            padTop        = this.m_padTop;
            ReportSize reportSize = null;

            if ((this.m_state & PaddingState.Top) == PaddingState.Clear)
            {
                reportSize = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingTop, source);
                if (reportSize != null)
                {
                    padTop       = reportSize.ToMillimeters();
                    padVertical += padTop;
                }
            }
            if ((this.m_state & PaddingState.Bottom) == PaddingState.Clear)
            {
                reportSize = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingBottom, source);
                if (reportSize != null)
                {
                    padVertical += reportSize.ToMillimeters();
                }
            }
            if ((this.m_state & PaddingState.Left) == PaddingState.Clear)
            {
                reportSize = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingLeft, source);
                if (reportSize != null)
                {
                    padHorizontal += reportSize.ToMillimeters();
                }
            }
            if ((this.m_state & PaddingState.Right) == PaddingState.Clear)
            {
                reportSize = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingRight, source);
                if (reportSize != null)
                {
                    padHorizontal += reportSize.ToMillimeters();
                }
            }
        }
Exemple #8
0
 public static double GetSizePropertyValue(ReportSizeProperty sizeProp, ReportSize instanceValue)
 {
     if (instanceValue != null)
     {
         return(instanceValue.ToMillimeters());
     }
     if (sizeProp != null && sizeProp.Value != null)
     {
         return(sizeProp.Value.ToMillimeters());
     }
     return(0.0);
 }
Exemple #9
0
        public ReportBody(Body source, ReportSize width)
            : base(null)
        {
            base.m_itemPageSizes        = new ItemSizes(0.0, 0.0, width.ToMillimeters(), source.Height.ToMillimeters());
            this.m_originalWidth        = base.m_itemPageSizes.Width;
            this.m_source               = source;
            base.KeepTogetherHorizontal = false;
            base.KeepTogetherVertical   = false;
            bool unresolvedKTV = base.UnresolvedKTH = false;

            base.UnresolvedKTV = unresolvedKTV;
        }
Exemple #10
0
 private ReportSize GetLargest(ReportSize size1, ReportSize size2)
 {
     if (size1 == null)
     {
         return(size2);
     }
     if (size2 == null)
     {
         return(size1);
     }
     if (size1.ToMillimeters() > size2.ToMillimeters())
     {
         return(size1);
     }
     return(size2);
 }
 public virtual void Update(ReportSize width, ReportSize height)
 {
     this.Clean();
     this.m_width  = width.ToMillimeters();
     this.m_height = height.ToMillimeters();
 }
 public ItemSizes(ReportSize width, ReportSize height, string id)
 {
     this.m_width  = width.ToMillimeters();
     this.m_height = height.ToMillimeters();
     this.m_id     = id;
 }
 internal virtual void Update(ReportSize width, ReportSize height)
 {
     Clean();
     m_width  = width.ToMillimeters();
     m_height = height.ToMillimeters();
 }
 internal ItemSizes(ReportSize width, ReportSize height, string id)
 {
     m_width  = width.ToMillimeters();
     m_height = height.ToMillimeters();
     m_id     = id;
 }
        public static void CreatePaddingsStyle(PageContext pageContext, ReportItem source, out double padVertical, out double padHorizontal, out double padTop)
        {
            padVertical   = 0.0;
            padHorizontal = 0.0;
            padTop        = 0.0;
            PaddingsStyle paddingsStyle = null;
            bool          flag          = true;
            double        num           = 0.0;
            ReportSize    styleValue    = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingTop, ref flag, source);

            if (styleValue != null)
            {
                num = styleValue.ToMillimeters();
                if (flag)
                {
                    if (paddingsStyle == null)
                    {
                        paddingsStyle = new PaddingsStyle();
                    }
                    paddingsStyle.PadVertical += num;
                    paddingsStyle.PadTop       = num;
                    paddingsStyle.State       |= PaddingState.Top;
                }
                padTop       = num;
                padVertical += num;
            }
            flag       = true;
            styleValue = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingBottom, ref flag, source);
            if (styleValue != null)
            {
                num = styleValue.ToMillimeters();
                if (flag)
                {
                    if (paddingsStyle == null)
                    {
                        paddingsStyle = new PaddingsStyle();
                    }
                    paddingsStyle.PadVertical += num;
                    paddingsStyle.State       |= PaddingState.Bottom;
                }
                padVertical += num;
            }
            flag       = true;
            styleValue = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingLeft, ref flag, source);
            if (styleValue != null)
            {
                num = styleValue.ToMillimeters();
                if (flag)
                {
                    if (paddingsStyle == null)
                    {
                        paddingsStyle = new PaddingsStyle();
                    }
                    paddingsStyle.PadHorizontal += num;
                    paddingsStyle.State         |= PaddingState.Left;
                }
                padHorizontal += num;
            }
            flag       = true;
            styleValue = PaddingsStyle.GetStyleValue(StyleAttributeNames.PaddingRight, ref flag, source);
            if (styleValue != null)
            {
                num = styleValue.ToMillimeters();
                if (flag)
                {
                    if (paddingsStyle == null)
                    {
                        paddingsStyle = new PaddingsStyle();
                    }
                    paddingsStyle.PadHorizontal += num;
                    paddingsStyle.State         |= PaddingState.Right;
                }
                padHorizontal += num;
            }
            if (paddingsStyle != null)
            {
                if (pageContext.ItemPaddingsStyle == null)
                {
                    pageContext.ItemPaddingsStyle = new Hashtable();
                }
                pageContext.ItemPaddingsStyle.Add(source.ID, paddingsStyle);
            }
        }