コード例 #1
0
        private static BorderProperties FillBorderProperties(IExcelGenerator excel, BorderProperties currBorder, BorderProperties border, ExcelBorderPart part, object style, object width, object color)
        {
            BorderProperties borderProperties = currBorder;

            if (style != null)
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style);
            }
            if (width != null)
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Width = LayoutConvert.ToPoints((string)width);
            }
            if (color != null && !color.Equals("Transparent"))
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Color = excel.AddColor((string)color);
            }
            return(borderProperties);
        }
コード例 #2
0
        internal HeaderFooterLayout(RPLReport report, float aWidth, float aHeight)
            : base(report)
        {
            m_fullList = new List <ReportItemInfo>();
            int num = LayoutConvert.ConvertMMTo20thPoints(aWidth);

            m_height      = aHeight;
            m_centerWidth = num / 3;
            m_rightWidth  = m_centerWidth * 2;
            m_leftList    = new List <ReportItemInfo>();
            m_centerList  = new List <ReportItemInfo>();
            m_rightList   = new List <ReportItemInfo>();
        }
コード例 #3
0
        internal static int GetPageSizeIndex(float pageWidth, float pageHeight, out bool isPortrait)
        {
            int num  = (int)Math.Round(pageWidth);
            int num2 = (int)Math.Round(pageHeight);

            for (int i = 0; i < m_mmWidth.Length; i++)
            {
                if (num2 == m_mmHeight[i] && num == m_mmWidth[i])
                {
                    isPortrait = true;
                    return(m_mmSizeIndex[i]);
                }
            }
            for (int j = 0; j < m_mmWidth.Length; j++)
            {
                if (num2 == m_mmWidth[j] && num == m_mmHeight[j])
                {
                    isPortrait = false;
                    return(m_mmSizeIndex[j]);
                }
            }
            float num3 = (float)Math.Round(LayoutConvert.ToInches(pageHeight.ToString(CultureInfo.InvariantCulture) + "mm"), 1);
            float num4 = (float)Math.Round(LayoutConvert.ToInches(pageWidth.ToString(CultureInfo.InvariantCulture) + "mm"), 1);

            for (int k = 0; k < m_inchWidth.Length; k++)
            {
                if (num3 == m_inchHeight[k] && num4 == m_inchWidth[k])
                {
                    isPortrait = true;
                    return(m_inchSizeIndex[k]);
                }
            }
            for (int l = 0; l < m_inchWidth.Length; l++)
            {
                if (num4 == m_inchHeight[l] && num3 == m_inchWidth[l])
                {
                    isPortrait = false;
                    return(m_inchSizeIndex[l]);
                }
            }
            if (pageHeight >= pageWidth)
            {
                isPortrait = true;
            }
            else
            {
                isPortrait = false;
            }
            return(0);
        }
コード例 #4
0
 private void FillBorderProperties(IExcelGenerator excel, BorderProperties border, object style, object width, object color)
 {
     if (style != null)
     {
         border.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style);
     }
     if (width != null)
     {
         border.Width = LayoutConvert.ToPoints((string)width);
     }
     if (color != null && !color.Equals("Transparent"))
     {
         border.Color = excel.AddColor((string)color);
     }
 }
コード例 #5
0
        internal void RenderStrings(RPLReport report, IExcelGenerator excel, out string left, out string center, out string right)
        {
            foreach (ReportItemInfo full in m_fullList)
            {
                RPLPageLayout rPLPageLayout = full.RPLSource as RPLPageLayout;
                if (rPLPageLayout != null)
                {
                    continue;
                }
                RPLTextBox   rPLTextBox = full.RPLSource as RPLTextBox;
                RPLItemProps rPLItemProps;
                byte         elementType;
                if (rPLTextBox != null)
                {
                    if (rPLTextBox.StartOffset > 0)
                    {
                        rPLItemProps = m_report.GetItemProps(rPLTextBox.StartOffset, out elementType);
                    }
                    else
                    {
                        rPLItemProps = (RPLItemProps)rPLTextBox.ElementProps;
                        elementType  = 7;
                    }
                }
                else
                {
                    rPLItemProps = m_report.GetItemProps(full.RPLSource, out elementType);
                }
                if (elementType == 7)
                {
                    full.Values = (RPLTextBoxProps)rPLItemProps;
                    RPLElementStyle     style = rPLItemProps.Style;
                    HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left;
                    object obj = style[25];
                    if (obj != null)
                    {
                        horizontalAlignment = LayoutConvert.ToHorizontalAlignEnum((RPLFormat.TextAlignments)obj);
                    }
                    int    num   = 0;
                    int    num2  = 0;
                    string text  = (string)rPLItemProps.Style[15];
                    string text2 = (string)rPLItemProps.Style[16];
                    if (text != null)
                    {
                        num = LayoutConvert.ConvertMMTo20thPoints(LayoutConvert.ToMillimeters(text));
                    }
                    if (text2 != null)
                    {
                        num2 = LayoutConvert.ConvertMMTo20thPoints(LayoutConvert.ToMillimeters(text2));
                    }
                    switch (horizontalAlignment)
                    {
                    case HorizontalAlignment.Left:
                        full.AlignmentPoint = full.Left + num;
                        break;

                    case HorizontalAlignment.Right:
                        full.AlignmentPoint = full.Right - num2;
                        break;

                    default:
                        full.AlignmentPoint = full.Left + (full.Right - full.Left + num - num2) / 2;
                        break;
                    }
                    if (full.AlignmentPoint < m_centerWidth)
                    {
                        m_leftList.Add(full);
                    }
                    else if (full.AlignmentPoint < m_rightWidth)
                    {
                        m_centerList.Add(full);
                    }
                    else
                    {
                        m_rightList.Add(full);
                    }
                }
            }
            m_leftList.Sort(ReportItemInfo.CompareTopsThenLefts);
            m_centerList.Sort(ReportItemInfo.CompareTopsThenLefts);
            m_rightList.Sort(ReportItemInfo.CompareTopsThenLefts);
            left   = RenderString(m_leftList, excel);
            center = RenderString(m_centerList, excel);
            right  = RenderString(m_rightList, excel);
        }