08-01-2022 06:21 AM
I have a table with n columns in a Diadem report page. The column 1 contains header information, so I want it to be always at constant width. Remaining columns should equally occupy the rest of the available width, it may be 2 or 3 or 4 columns based on test condition.
is there a way to have different width for different columns in a report table?
is there a option to use autofit the column width based on the text content inside the column?
Regards,
Durai
08-04-2022 01:57 AM
Hi Durai26,
DIAdem Report tables have the option for different sizes per column.
You can change that in the settings dialog or per script as below:
Dim oCtrl, dWidth, dWidthRest, dWidthColA, dWidthPerChn, iNoOfChn, iLoop
Set oCtrl = Report.Sheets("Sheet 1").Objects("2DTable1")
dWidthColA = 20
iNoOfChn = oCtrl.Columns.Count
dWidth = 100 - oCtrl.Position.ByBorder.Right - oCtrl.Position.ByBorder.Left
dWidthRest = dWidth - dWidthColA
dWidthPerChn = dWidthRest / iNoOfChn
oCtrl.Columns(1).Settings.RelativeColumnWidth = dWidthColA
for iLoop = 2 to oCtrl.Columns.Count
oCtrl.Columns(iLoop).Settings.RelativeColumnWidth = dWidthPerChn
next
Greetings
Walter