MBS DynaPDF Set Column Width

In the example how do I give 3 different values to the width of three columns ?
And 'you can not display a column ?

// create table
dim ColumnCount as integer = Listbox1.ColumnCount
dim tbl as DynaPDFTableMBS = pdf.CreateTable(3, ColumnCount, 500.0, 100.0)
call tbl.SetBorderWidth(-1, -1, 1.0, 1.0, 1.0, 1.0)
call tbl.SetGridWidth( 1.0, 1.0)
call tbl.SetGridHorizontalColor(100, 100, 100)
call tbl.SetGridVerticalColor(100, 100, 100)
call tbl.SetBorderColor(-1, -1, 100, 100, 100)

// add header row
dim rowNum as integer = tbl.AddRow
call tbl.SetFlags rowNum, -1, tbl.ktfHeaderRow

for i as integer = 0 to ColumnCount-1
call tbl.SetCellText rowNum, i, pdf.ktaLeft, tbl.kcoCenter, Listbox1.Heading(i)

// now fill all the cells
dim c as integer = Listbox1.ListCount-1
for Row as integer = 0 to c
rowNum = tbl.AddRow
for Column as integer = 0 to ColumnCount-1
// which alignment for this cell?
dim AlignMent as integer = pdf.ktaLeft
Select case Listbox1.ColumnAlignment(column)
case Listbox1.AlignCenter
AlignMent = pdf.ktaCenter
case Listbox1.AlignRight
AlignMent = pdf.ktaRight
end Select

  call tbl.SetCellText rowNum, Column, AlignMent,   tbl.kcoCenter, Listbox1.Cell(row, Column)


// Draw the table now
call pdf.Append
call tbl.DrawTable(50.0, 50.0, 742.0)
while tbl.HaveMore
call pdf.EndPage
call pdf.Append
call tbl.DrawTable(50.0, 50.0, 742.0)
call pdf.EndPage

have you tried to call SetColWidth method?

SetColWidth(column as UInt32, Width as double, ExtTable as Boolean) as boolean

but returns a Boolean value, I do not understand how to use this feature to assign column width. An example ?

It returns a boolean value, whether you care or not is up to you.

I’m not sure what ExtTable is, so just filling it in with true here:

dim bSuccess as Boolean = SetColWidth(-1, 100, true)

Assuming it’s a success boolean, bSuccess will tell you whether or not the method was successful.

If you really don’t care, and just want to throw values at the wall:

call SetColWidth(-1, 100, true)

from example project:

call table.SetColWidth(0, 28.0, false) call table.SetColWidth(1, 60.0, false) call table.SetColWidth(2, 250.0, false) call table.SetColWidth(3, 40.0, false)

ExtTable defines if table should be extended if table is not wide enough.

ok thanks

Another question: you can hide a column ?

Well, the best would to filter it and not pass data for column to DynaPDF.