コード例 #1
0
        public override void Build(XlsArea area, XlsFormColumnAdjuster adjuster)
        {
            var maxRow = Cells.Max(c => c.Row);
            var maxCol = Cells.Max(c => c.Col);

            for (var r = 0; r <= maxRow; r++)
            {
                var row = area.AddRow();

                var info = adjuster.Find(this, -1);
                if (LeftMargin > 0)
                {
                    var marginCell = row.AddEmptyCell(info != null ? info.ColSpan : 0);
                    marginCell.Style.Borders = TableCellBorder.None;
                }

                for (var c = 0; c <= maxCol; c++)
                {
                    info = adjuster.Find(this, c);
                    var cell = Cells.FirstOrDefault(i => i.Row == r && i.Col == c);
                    if (cell != null)
                    {
                        var xlsCell = row.AddText(cell.Text, info != null ? info.ColSpan : 1);
                        xlsCell.Style = ContentStyle.MergeStyles(Style, cell.Style);
                    }
                    else
                    {
                        var xlsCell = row.AddText("", info != null ? info.ColSpan : 1);
                        xlsCell.Style = Style;
                    }
                }
            }
        }
コード例 #2
0
        public override void Build(XlsArea area, XlsFormColumnAdjuster adjuster)
        {
            var row = area.AddRow();

            var info = adjuster.Find(this, -1);

            if (LeftMargin > 0)
            {
                row.AddEmptyCell(info != null ? info.ColSpan : 0);
            }
            info = adjuster.Find(this, 0);
            var cell = row.AddText(Text, info != null ? info.ColSpan : 1);

            cell.Style = Style;
        }
コード例 #3
0
 public virtual void Build(XlsArea area, XlsFormColumnAdjuster adjuster)
 {
 }