Table header

Table header

SAPER59
Advocate Advocate
1,844 Views
8 Replies
Message 1 of 9

Table header

SAPER59
Advocate
Advocate

I need to create 2 rows as headers, in a Table, so I wil have 1 for title and 2 for header, so when splitt the table both rows are repeated, but can not, can define just one

Thanks to any help

0 Likes
1,845 Views
8 Replies
Replies (8)
Message 2 of 9

CodeDing
Advisor
Advisor

@SAPER59 ,

 

Are you trying to accomplish something programmatically? Do you have any existing code? 

Otherwise, this can easily be done by creating table, highlight first "Data" row, in Properties change "Row style" from "Data" to "Header".

 

Best,

~DD

0 Likes
Message 3 of 9

SAPER59
Advocate
Advocate

Yes I need it to do in Visual Lisp, as part of a code

0 Likes
Message 4 of 9

CodeDing
Advisor
Advisor

@SAPER59 ,

 

It looks like you can SetCellStyle for each cell in a row to make them "Header", but this must be done for each cell in the row. I can NOT find out how to set the "Row style" property for an individual row. But I think you can still work with this information to accomplish what you desire.

(vla-setcellstyle (vlax-ename->vla-object (car (entsel))) 2 0 "Header");row/col/style(string)

Best,

~DD

0 Likes
Message 5 of 9

SAPER59
Advocate
Advocate

Codeding, what you sent me works to get format text as HEADER but if you do a TableBreakHeight they are not repeated in splitted tables as do Title and normal header. Anyway thanks, it works but not for my needs

0 Likes
Message 6 of 9

SAPER59
Advocate
Advocate

It seems that setting ROWSTYLE as doing manually it works, but can not find a way to set rowstyle in visual lisp . Is it there anyone?

Message 7 of 9

hak_vz
Advisor
Advisor

I'm not an expert when it comes to work with tables, and your post has actually motivated me to try to do some stuff with autolisp  generated  table objects after many years. I'm maybe completely wrong, but look this:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-cell-style-via-lisp/m-p/7220177/... 

 

You should reshape this code (which applies style "data" to all cells in table)  so that it applies style "Title" to cells in first row, and "Header" to those in second row.  You may also use what @CodeDing proposed but then add counters instead "2 0" in 

(vla-setcellstyle (vlax-ename->vla-object (car (entsel))) 2 0 "Header")

 If you modify existent table to a column then  that function has to reapply this to that particular column. For anything more we would need more details or a sample.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 8 of 9

SAPER59
Advocate
Advocate

Ranjit

I ahve already done it, before reasking but the behavor is as I told

I created a function but when I split it with 

(vla-put-TableBreakHeight myTable brkheight)

they remain as data fields, not as headers and aren't repeated in new tables pieces.

 

(defun defineasheader (myTable nofcols lofrows / n d col row)
(setq col 0)
(while (< col nofcols)
(setq j 0)
(while (< j (length lofrows))
(setq row (nth j lofrows))
(vla-setcellstyle myTable row col "Header");row/col/style(string)
(setq j (1+ j))
)
(setq col (1+ col))
)
(princ)
)

0 Likes
Message 9 of 9

hak_vz
Advisor
Advisor

It is hard to talk about tables without a sample.  Have been googling about your problem, and have found this old post

https://forums.autodesk.com/t5/autocad-forum/table-breaks-quot-repeat-top-labels-quot-formatting/td-... 

Maybe it helps in resolving a problem.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes