Dear all, I need support for an issue with table.
I have a table composed by 70 rows and 12 columns, Rows height and columns width has been settled before as preliminary, when table being inserted in the drawing.
The scope is to fit the column size to cell contents, with a fixed row height.
Of course I don't know, before writing data into the table's cell, if the contents length will be higher than the columns width, so when table will be drawn and updated I would like to adapt the columns width to cell contents.
I tried to apply the below code but nothing is changing, I tried after writing the cells contents and before writing the cells contents but result it's the same: if cell's contents it's higher than columns width I have the contents carriage return results. See image below.
I Tried also to use the Autoscale2 method but I do not understand how to use nContent parameter, due to it's required as long type variable instead a text as table data cells required.
RetVal = object.GetAutoScale2(nRow, nCol, nContent)
- object
- Type: Table
The object this method applies to. - nRow
- Access: Input-only
Type: Long
The row number of the cell to set. - nCol
- Access: Input-only
Type: Long
The column number of the cell to set. - nContent
- Access: Input-only
Type: Long
The content value for the cell.
Return Value (RetVal)
Type: Boolean
- True: AutoScale is used for the content with the index at the cell location.
- False: AutoScale is not used for the content with the index at the cell location.
Code:
For i = 2 To .Rows - 1
For j = 0 To .Columns - 1
Actable.SetAutoScale i, j, False 'or True
Next j
Next i