Owl.Word.WordBuilder.CreateTable C# (CSharp) Метод

CreateTable() публичный Метод

public CreateTable ( DataTable table, TableStyle style ) : void
table System.Data.DataTable
style TableStyle
Результат void
        public void CreateTable(DataTable table, TableStyle style)
        {
            TableCreator tableCreator = new TableCreator();
            tableCreator.AddTable(this._package, table, style);
        }

Same methods

WordBuilder::CreateTable ( DataTable table ) : void

Usage Example

Пример #1
0
        private static void AddTable(WordBuilder builder)
        {
            using (var table = new DataTable()) {

                table.Columns.Add("Item", typeof(string));
                table.Columns.Add("Min", typeof(string));
                table.Columns.Add("Avg", typeof(string));
                table.Columns.Add("Max", typeof(string));

                for (int i = 0; i < 10; i++) {

                    var r = table.NewRow();
                    r[0] = i.ToString(); r[1] = 10M.ToString(); r[2] = 11M.ToString(); r[3] = 12M.ToString();

                    table.Rows.Add(r);
                }

                builder.CreateTable(table, new TableStyle() {
                    Alignment = HorizontalAlignmentType.Center,
                    ShowTitle = true,
                    Title = "My Table"
                });
            }
        }