Creating a Table That Repeats the Headers

Creating a Table That Repeats the Headers

mgorecki
Collaborator Collaborator
374 Views
3 Replies
Message 1 of 4

Creating a Table That Repeats the Headers

mgorecki
Collaborator
Collaborator

I have code that creates the table style and also creates a table.  I've set a few options like layer, width, and BreakEnabled.  I would like to set the option for repeating headers, but I can't find anything.  The goofy AI in Google tells me different things on how to do it, but none of them work.

Does anyone have a way to create a table and set it so that it has a repeating header?

 

Thanks

0 Likes
Accepted solutions (1)
375 Views
3 Replies
Replies (3)
Message 2 of 4

ActivistInvestor
Mentor
Mentor
Accepted solution

You have to enable the appropriate Flags in the table's BreakOptions property. See the TableBreakOptions.RepeatTopLabels enum member. 

0 Likes
Message 3 of 4

mgorecki
Collaborator
Collaborator

Ok, thanks, I'll give this a try.

0 Likes
Message 4 of 4

mgorecki
Collaborator
Collaborator

This is what I ended up doing which sets the RepeatTopLabels to 2 (True)

Using tableTrans As Transaction = podDB.TransactionManager.StartTransaction()
    Dim smdBT As BlockTable = DirectCast(tableTrans.GetObject(podDWG.Database.BlockTableId, OpenMode.ForRead), BlockTable)
    Dim smdTableBtr As BlockTableRecord = CType(tableTrans.GetObject(smdBT(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
    Dim txtTbl As TextStyleTable = CType(tableTrans.GetObject(podDB.TextStyleTableId, OpenMode.ForRead), TextStyleTable)
    Dim smdTable As Table = New Table()
    tableLocY = ((dtaCellHgt * 2) + hdrCellHgt)
    tableLoc = New Point3d(tableLocX, tableLocY, 0)
    smdTable.Position = tableLoc
    smdTable.Width = smdTableWidth
    smdTable.BreakEnabled = True
    smdTable.BreakOptions = CType(TableBreakOptions.RepeatTopLabels, DatabaseServices.TableBreakOptions)
:
:
0 Likes