Exemplo n.º 1
0
 public static void AddTableRowProperties(TableRow tableRow, StringBuilder style)
 {
     if (tableRow.GetRowHeight() > 0)
     {
         style.Append("height:" + (tableRow.GetRowHeight() / TWIPS_PER_INCH) + "in;");
     }
     if (!tableRow.cantSplit())
     {
         style.Append("keep-together:always;");
     }
 }
Exemplo n.º 2
0
 public static void SetTableRowProperties(TableRow tableRow, XmlElement tableRowXmlElement)
 {
     if (tableRow.GetRowHeight() > 0)
     {
         tableRowXmlElement.SetAttribute("height",
                 (tableRow.GetRowHeight() / TWIPS_PER_INCH) + "in");
     }
     if (!tableRow.cantSplit())
     {
         tableRowXmlElement.SetAttribute("keep-together.within-column",
                 "always");
     }
 }
Exemplo n.º 3
0
        public static void AddTableCellProperties(TableRow tableRow,
                TableCell tableCell, bool toppest, bool bottomest,
                bool leftest, bool rightest, StringBuilder style)
        {
            style.Append("width:" + (tableCell.GetWidth() / TWIPS_PER_INCH) + "in;");
            style.Append("padding-start:" + (tableRow.GetGapHalf() / TWIPS_PER_INCH) + "in;");
            style.Append("padding-end:" + (tableRow.GetGapHalf() / TWIPS_PER_INCH) + "in;");

            BorderCode top = tableCell.GetBrcTop() != null
                    && tableCell.GetBrcTop().BorderType != 0 ? tableCell
                    .GetBrcTop() : toppest ? tableRow.GetTopBorder() : tableRow
                    .GetHorizontalBorder();
            BorderCode bottom = tableCell.GetBrcBottom() != null
                    && tableCell.GetBrcBottom().BorderType != 0 ? tableCell
                    .GetBrcBottom() : bottomest ? tableRow.GetBottomBorder()
                    : tableRow.GetHorizontalBorder();

            BorderCode left = tableCell.GetBrcLeft() != null
                    && tableCell.GetBrcLeft().BorderType != 0 ? tableCell
                    .GetBrcLeft() : leftest ? tableRow.GetLeftBorder() : tableRow
                    .GetVerticalBorder();
            BorderCode right = tableCell.GetBrcRight() != null
                    && tableCell.GetBrcRight().BorderType != 0 ? tableCell
                    .GetBrcRight() : rightest ? tableRow.GetRightBorder()
                    : tableRow.GetVerticalBorder();

            AddBorder(bottom, "bottom", style);
            AddBorder(left, "left", style);
            AddBorder(right, "right", style);
            AddBorder(top, "top", style);
        }
Exemplo n.º 4
0
        public static void SetTableCellProperties(TableRow tableRow,
                TableCell tableCell, XmlElement XmlElement, bool toppest,
                bool bottomest, bool leftest, bool rightest)
        {
            XmlElement.SetAttribute("width", (tableCell.GetWidth() / TWIPS_PER_INCH)
                    + "in");
            XmlElement.SetAttribute("padding-start",
                    (tableRow.GetGapHalf() / TWIPS_PER_INCH) + "in");
            XmlElement.SetAttribute("padding-end",
                    (tableRow.GetGapHalf() / TWIPS_PER_INCH) + "in");

            BorderCode top = tableCell.GetBrcTop() != null
                    && tableCell.GetBrcTop().BorderType != 0 ? tableCell
                    .GetBrcTop() : toppest ? tableRow.GetTopBorder() : tableRow
                    .GetHorizontalBorder();
            BorderCode bottom = tableCell.GetBrcBottom() != null
                    && tableCell.GetBrcBottom().BorderType != 0 ? tableCell
                    .GetBrcBottom() : bottomest ? tableRow.GetBottomBorder()
                    : tableRow.GetHorizontalBorder();

            BorderCode left = tableCell.GetBrcLeft() != null
                    && tableCell.GetBrcLeft().BorderType != 0 ? tableCell
                    .GetBrcLeft() : leftest ? tableRow.GetLeftBorder() : tableRow
                    .GetVerticalBorder();
            BorderCode right = tableCell.GetBrcRight() != null
                    && tableCell.GetBrcRight().BorderType != 0 ? tableCell
                    .GetBrcRight() : rightest ? tableRow.GetRightBorder()
                    : tableRow.GetVerticalBorder();

            SetBorder(XmlElement, bottom, "bottom");
            SetBorder(XmlElement, left, "left");
            SetBorder(XmlElement, right, "right");
            SetBorder(XmlElement, top, "top");
        }