DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Manage Report Table Column width using DIADEM scripts.

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

 

0 Kudos
Message 1 of 2
(749 Views)

Hi Durai26,

 

DIAdem Report tables have the option for different sizes per column.

 

p1.png

 

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

0 Kudos
Message 2 of 2
(719 Views)