girls3dog1
Programmer
I'd like to dynamically modify the height of a column datawindow object as function of the string length for the data in that column. I want to minimize white space in the datawindow because row data may have 1 character in this column and the next row may have 150 characters or more for the same column. Yes, I can fix the column object height for the worst case, but presentation-wise this would look unappealing to the user.
I've been playing with the code below, but I'm wondering if there's a more elegant method to detect when I've reached or exceeded the column width with text.
long ll_row_count, ll_description
integer i
ll_row_count = dw_datasheet_note.rowcount()
If ll_row_count < 1 then return
For i = 1 to ll_row_count
ll_description = len(dw_datasheet_note.getitemstring(i,"tbl_notes_general_description")
Choose case ll_description
Case is > 91
dw_datasheet_note.object.tbl_notes_general_description.height = 284
Case is > 61
dw_datasheet_note.object.tbl_notes_general_description.height = 228
Case is > 31
dw_datasheet_note.object.tbl_notes_general_description.height = 152
Case is < 30
dw_datasheet_note.object.tbl_notes_general_description.height = 76
End Choose
Next
I've been playing with the code below, but I'm wondering if there's a more elegant method to detect when I've reached or exceeded the column width with text.
long ll_row_count, ll_description
integer i
ll_row_count = dw_datasheet_note.rowcount()
If ll_row_count < 1 then return
For i = 1 to ll_row_count
ll_description = len(dw_datasheet_note.getitemstring(i,"tbl_notes_general_description")
Choose case ll_description
Case is > 91
dw_datasheet_note.object.tbl_notes_general_description.height = 284
Case is > 61
dw_datasheet_note.object.tbl_notes_general_description.height = 228
Case is > 31
dw_datasheet_note.object.tbl_notes_general_description.height = 152
Case is < 30
dw_datasheet_note.object.tbl_notes_general_description.height = 76
End Choose
Next